Skip to content

Commit

Permalink
Update rules metadata (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
yassin-kammoun-sonarsource committed Nov 30, 2021
1 parent 154a1b6 commit 8132d33
Show file tree
Hide file tree
Showing 90 changed files with 508 additions and 361 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-125",
"sqKey": "AvoidCommentedOutCodeCheck",
"scope": "All"
"scope": "All",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p>Using HTML-style comments in a page that will be generated or interpolated server-side before being served to the user increases the risk of
exposing data that should be kept private. For instance, a developer comment or line of debugging information that's left in a page could easily (and
exposing data that should be kept private. For instance, a developer comment or line of debugging information thats left in a page could easily (and
has) inadvertently expose:</p>
<ul>
<li> Version numbers and host names </li>
Expand Down Expand Up @@ -36,6 +36,6 @@ <h2>See</h2>
<ul>
<li> <a href="https://www.owasp.org/index.php/Top_10-2017_A3-Sensitive_Data_Exposure">OWASP Top 10 2017 Category A3</a> - Sensitive Data Exposure
</li>
<li> <a href="http://cwe.mitre.org/data/definitions/615.html">MITRE, CWE-615</a> - Information Exposure Through Comments </li>
<li> <a href="https://cwe.mitre.org/data/definitions/615.html">MITRE, CWE-615</a> - Information Exposure Through Comments </li>
</ul>

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p>The <code>&lt;strong&gt;</code>/<code>&lt;b&gt;</code> and <code>&lt;em&gt;</code>/<code>&lt;i&gt;</code> tags have exactly the same effect in most
web browsers, but there is a fundamental difference between them: <code>&lt;strong&gt;</code> and <code>&lt;em&gt;</code> have a semantic meaning
whereas <code>&lt;b&gt;</code> and <code>&lt;i&gt;</code> only convey styling information like CSS. </p>
whereas <code>&lt;b&gt;</code> and <code>&lt;i&gt;</code> only convey styling information like CSS.</p>
<p>While <code>&lt;b&gt;</code> can have simply no effect on a some devices with limited display or when a screen reader software is used by a blind
person, <code>&lt;strong&gt;</code> will:</p>
<ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "\"<strong>\" and \"<em>\" tags should be used",
"title": "\"\u003cstrong\u003e\" and \"\u003cem\u003e\" tags should be used",
"type": "BUG",
"status": "ready",
"remediation": {
Expand All @@ -12,5 +12,6 @@
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1100",
"sqKey": "BoldAndItalicTagsCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
"title": "Track uses of disallowed child elements",
"type": "CODE_SMELL",
"status": "ready",
"tags": [

],
"remediation": {
"func": "Constant\/Issue",
"constantCost": "10min"
},
"tags": [],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1931",
"sqKey": "ChildElementIllegalCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p>This rule checks that the specified child elements are present inside the specified parent elements. </p>
<p>This rule checks that the specified child elements are present inside the specified parent elements.</p>
<h2>Noncompliant Code Example</h2>
<p>Given a parent/child combination of <code>&lt;head&gt;</code>/<code>&lt;title&gt;</code>:</p>
<pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
"title": "Track lack of required child elements",
"type": "CODE_SMELL",
"status": "ready",
"tags": [

],
"remediation": {
"func": "Constant\/Issue",
"constantCost": "5min"
},
"tags": [],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1933",
"sqKey": "ChildElementRequiredCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
"linearOffset": "30min",
"linearFactor": "1min"
},
"tags": [

],
"tags": [],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1908",
"sqKey": "ComplexityCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "\"<!DOCTYPE>\" declarations should appear before \"<html>\" tags",
"title": "\"\u003c!DOCTYPE\u003e\" declarations should appear before \"\u003chtml\u003e\" tags",
"type": "BUG",
"status": "ready",
"remediation": {
Expand All @@ -12,5 +12,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1095",
"sqKey": "DoctypePresenceCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1457",
"sqKey": "DoubleQuotesCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p>Content that doesn't change or that doesn't change often should be included using a mechanism which won't try to interpret it. Specifically,
<p>Content that doesnt change or that doesnt change often should be included using a mechanism which wont try to interpret it. Specifically,
<code>&lt;%@ include file="..." %&gt;</code>, which includes the file in the JSP servlet translation phase (i.e. it happens once), should be used
instead of <code>&lt;jsp:include page="..." /&gt;</code>, which includes the page on the file, when the content is being served to the user.</p>
<h2>Noncompliant Code Example</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1937",
"sqKey": "DynamicJspIncludeCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p>For users of assistive technology such as screen readers, it may be challenging to know what is expected in each form's input. The input's label
<p>For users of assistive technology such as screen readers, it may be challenging to know what is expected in each forms input. The inputs label
alone might not be sufficient: 'street' could be part of a billing or a shipping address for instance.</p>
<p>Fieldset legends are read out loud by screen readers before the label each time the focus is set on an input. For example, a legend 'Billing
address' with a label 'Street' will read 'Billing address street'. Legends should be short, and 'Your' should not be repeated in both the legend and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "\"<fieldset>\" tags should contain a \"<legend>\"",
"title": "\"\u003cfieldset\u003e\" tags should contain a \"\u003clegend\u003e\"",
"type": "BUG",
"status": "ready",
"remediation": {
Expand All @@ -12,5 +12,6 @@
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1089",
"sqKey": "FieldsetWithoutLegendCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-104",
"sqKey": "FileLengthCheck",
"scope": "All"
"scope": "All",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "Flash animations should be embedded using both \"<object>\" and \"<embed>\"",
"title": "Flash animations should be embedded using both \"\u003cobject\u003e\" and \"\u003cembed\u003e\"",
"type": "BUG",
"status": "ready",
"remediation": {
Expand All @@ -12,5 +12,6 @@
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1087",
"sqKey": "FlashUsesBothObjectAndEmbedCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p>Frames allow different web pages to be put together on the same visual space. Users without disabilities can easily scan the contents of all frames
at once. However, visually impaired users using screen readers hear the page content linearly.</p>
<p>The <code>title</code> attribute is used to list all the page's frames, enabling those users to easily navigate among them. Therefore, the
<p>The <code>title</code> attribute is used to list all the pages frames, enabling those users to easily navigate among them. Therefore, the
<code>&lt;frame&gt;</code> and <code>&lt;iframe&gt;</code> tags should always have a <code>title</code> attribute.</p>
<h2>Noncompliant Code Example</h2>
<pre>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "\"<frames>\" should have a \"title\" attribute",
"title": "\"\u003cframes\u003e\" should have a \"title\" attribute",
"type": "BUG",
"status": "ready",
"remediation": {
Expand All @@ -12,5 +12,6 @@
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1090",
"sqKey": "FrameWithoutTitleCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p>Each source file should start with a header stating file ownership and the license which must be used to distribute the application. </p>
<p>Each source file should start with a header stating file ownership and the license which must be used to distribute the application.</p>
<p>This rule must be fed with the header text that is expected at the beginning of every file.</p>
<h2>Noncompliant Code Example</h2>
<pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
"func": "Constant\/Issue",
"constantCost": "5min"
},
"tags": [

],
"tags": [],
"defaultSeverity": "Blocker",
"ruleSpecification": "RSPEC-1451",
"sqKey": "HeaderCheck",
"scope": "All"
"scope": "All",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
"title": "Track uses of disallowed attributes",
"type": "CODE_SMELL",
"status": "ready",
"tags": [

],
"remediation": {
"func": "Constant\/Issue",
"constantCost": "10min"
},
"tags": [],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1934",
"sqKey": "IllegalAttributeCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
"title": "Track uses of disallowed elements",
"type": "CODE_SMELL",
"status": "ready",
"tags": [

],
"remediation": {
"func": "Constant\/Issue",
"constantCost": "10min"
},
"tags": [],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1936",
"sqKey": "IllegalElementCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
"title": "Track uses of disallowed namespaces in XHTML documents",
"type": "CODE_SMELL",
"status": "ready",
"tags": [

],
"remediation": {
"func": "Constant\/Issue",
"constantCost": "30min"
},
"tags": [],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1297",
"sqKey": "IllegalNamespaceCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-105",
"sqKey": "IllegalTabCheck",
"scope": "All"
"scope": "All",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
"func": "Constant\/Issue",
"constantCost": "1h"
},
"tags": [

],
"tags": [],
"defaultSeverity": "Blocker",
"ruleSpecification": "RSPEC-1928",
"sqKey": "IllegalTagLibsCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<li> Images loading is disabled, to reduce data consumption on mobile phones </li>
</ul>
<p>It is also very important to not set an <code>alt</code> attribute to a non-informative value. For example <code>&lt;img ... alt="logo"&gt;</code>
is useless as it doesn't give any information to the user. In this case, as for any other decorative image, it is better to use a CSS background image
is useless as it doesnt give any information to the user. In this case, as for any other decorative image, it is better to use a CSS background image
instead of an <code>&lt;img&gt;</code> tag. If using CSS background-image is not possible, an empty <code>alt=""</code> is tolerated. See Exceptions
bellow.</p>
<p>This rule raises an issue when</p>
Expand Down Expand Up @@ -46,7 +46,7 @@ <h2>Compliant Solution</h2>
&lt;/map&gt;
</pre>
<h2>Exceptions</h2>
<p><code>&lt;img&gt;</code> tags with empty string&nbsp;<code>alt=""</code> attributes won't raise any issue. However this technic should be used in
<p><code>&lt;img&gt;</code> tags with empty string&nbsp;<code>alt=""</code> attributes wont raise any issue. However this technic should be used in
two cases only:</p>
<p>When the image is decorative and it is not possible to use a CSS background image. For example, when the decorative <code>&lt;img&gt;</code> is
generated via javascript with a source image coming from a database, it is better to use an <code>&lt;img alt=""&gt;</code> tag rather than generate
Expand All @@ -56,8 +56,8 @@ <h2>Exceptions</h2>
&lt;img [src]="image" alt=""&gt;
&lt;/li&gt;
</pre>
<p>When the image is not decorative but it's <code>alt</code> text would repeat a nearby text. For example, images contained in links should not
duplicate the link's text in their <code>alt</code> attribute, as it would make the screen reader repeat the text twice.</p>
<p>When the image is not decorative but its <code>alt</code> text would repeat a nearby text. For example, images contained in links should not
duplicate the links text in their <code>alt</code> attribute, as it would make the screen reader repeat the text twice.</p>
<pre>
&lt;a href="flowers.html"&gt;
&lt;img src="tulip.gif" alt="" /&gt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1077",
"sqKey": "ImgWithoutAltCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1099",
"sqKey": "ImgWithoutWidthOrHeightCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
"func": "Constant\/Issue",
"constantCost": "15min"
},
"tags": [

],
"tags": [],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1935",
"sqKey": "InlineStyleCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1097",
"sqKey": "InputWithoutLabelCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1926",
"sqKey": "InternationalizationCheck",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Loading

0 comments on commit 8132d33

Please sign in to comment.