Skip to content

Commit 6ddf7ca

Browse files
authored
Rules metadata update (#1466)
1 parent 83f0763 commit 6ddf7ca

File tree

195 files changed

+635
-463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+635
-463
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
<sonar.version>9.7.1.62043</sonar.version>
9494
<sonar.orchestrator.version>3.40.0.183</sonar.orchestrator.version>
9595
<sonar.api.version>9.11.0.290</sonar.api.version>
96-
<sonar-analyzer-commons.version>2.4.0.1317</sonar-analyzer-commons.version>
96+
<sonar-analyzer-commons.version>2.5.0.1358</sonar-analyzer-commons.version>
9797
<sonarlint-core.version>8.14.0.63103</sonarlint-core.version>
9898
<sslr.version>1.23</sslr.version>
9999
<protobuf.version>3.21.7</protobuf.version>

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/BackticksUsage.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
<h2>Why is this an issue?</h2>
12
<p>Backticks are a deprecated alias for <code>repr()</code>. Don’t use them any more, the syntax was removed in Python 3.0.</p>
2-
<h2>Noncompliant Code Example</h2>
3+
<h3>Noncompliant code example</h3>
34
<pre>
45
return `num` # Noncompliant
56
</pre>
6-
<h2>Compliant Solution</h2>
7+
<h3>Compliant solution</h3>
78
<pre>
89
return repr(num)
910
</pre>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
<p>This rule is deprecated, and will eventually be removed.</p>
2+
<h2>Why is this an issue?</h2>
13
<p>The cyclomatic complexity of a class should not exceed a defined threshold. Complex code can perform poorly and will in any case be difficult to
24
understand and therefore to maintain.</p>
3-
<h2>Deprecated</h2>
4-
<p>This rule is deprecated, and will eventually be removed.</p>
55

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/CommentRegularExpression.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<h2>Why is this an issue?</h2>
12
<p>This rule template can be used to create rules which will be triggered when a comment matches a given regular expression.</p>
23
<p>For example, one can create a rule with the regular expression <code>.*REVIEW.*</code> to match all comment containing "REVIEW".</p>
34
<p>Note that, in order to match REVIEW regardless of the case, the <code>(?i)</code> modifier should be prepended to the expression, as in

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/ExecStatementUsage.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
<h2>Why is this an issue?</h2>
12
<p>Use of the <code>exec</code> statement could be dangerous, and should be avoided. Moreover, the <code>exec</code> statement was removed in Python
23
3.0. Instead, the built-in <code>exec()</code> function can be used.</p>
3-
<h2>Noncompliant Code Example</h2>
4+
<h3>Noncompliant code example</h3>
45
<pre>
56
exec 'print 1' # Noncompliant
67
</pre>
7-
<h2>Compliant Solution</h2>
8+
<h3>Compliant solution</h3>
89
<pre>
910
exec('print 1')
1011
</pre>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<p>Most of the time, a very complex file breaks the Single Responsibility Principle and should be re-factored into several different files.</p>
2-
<h2>Deprecated</h2>
31
<p>This rule is deprecated, and will eventually be removed.</p>
2+
<h2>Why is this an issue?</h2>
3+
<p>Most of the time, a very complex file breaks the Single Responsibility Principle and should be re-factored into several different files.</p>
44

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<h2>Why is this an issue?</h2>
12
<p>The Cyclomatic Complexity of functions should not exceed a defined threshold. Complex code may perform poorly and can be difficult to test
23
thoroughly.</p>
34

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/InequalityUsage.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
<h2>Why is this an issue?</h2>
12
<p>The forms <code>&lt;&gt;</code> and <code>!=</code> are equivalent. But in Python 2.7.3 the <code>&lt;&gt;</code> form is considered obsolete.</p>
2-
<h2>Noncompliant Code Example</h2>
3+
<h3>Noncompliant code example</h3>
34
<pre>
45
return a &lt;&gt; b # Noncompliant
56
</pre>
6-
<h2>Compliant Solution</h2>
7+
<h3>Compliant solution</h3>
78
<pre>
89
return a != b
910
</pre>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
<h2>Why is this an issue?</h2>
12
<p>Having to scroll horizontally makes it harder to get a quick overview and understanding of any piece of code.</p>
23

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/LongIntegerWithLowercaseSuffixUsage.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
<h2>Why is this an issue?</h2>
12
<p>The long suffix should always be written in uppercase, i.e. 'L', as the lowercase 'l' can easily be confused with the digit one '1'.</p>
2-
<h2>Noncompliant Code Example</h2>
3+
<h3>Noncompliant code example</h3>
34
<pre>
45
return 10l // Noncompliant; easily confused with one zero one
56
</pre>
6-
<h2>Compliant Solution</h2>
7+
<h3>Compliant solution</h3>
78
<pre>
89
return 10L
910
</pre>

0 commit comments

Comments
 (0)