Skip to content

Commit

Permalink
SONARFLEX-188 Revert sonar-flex deprecation (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
yassin-kammoun-sonarsource authored Nov 22, 2024
1 parent 2aee7b5 commit bae5be0
Show file tree
Hide file tree
Showing 158 changed files with 496 additions and 690 deletions.
19 changes: 1 addition & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
> [!WARNING]
> Deprecation Notice
>
> We are deprecating the SonarQube Flex analyzer.
>
> Our plan is to eventually stop maintaining it ourselves, while leaving it available in Open Source, in case the community wants to take it over.
>
> Timeline:
> * August 2024: All rules are now deprecated to let users know of the change
> * January 2025: SonarQube v11 will be the last version to include the Flex analyzer
> * First half of 2025: Flex analysis will no longer be available in SonarCloud
> * First half of 2025: This repository will be archived and remain available online
>
> You'll continue to be able to build the plugin and use it in your SonarQube instance as long as it remains functional. You can also fork the repository and make changes as you see fit.
>
> Thanks to everyone for their involvement!
Code Quality and Security for Flex [![Build Status](https://travis-ci.org/SonarSource/sonar-flex.svg?branch=master)](https://travis-ci.org/SonarSource/sonar-flex)
==========

Expand All @@ -26,4 +9,4 @@ Copyright 2010-2024 SonarSource.

SonarQube analyzers released after November 29, 2024, including patch fixes for prior versions, are published under the [Sonar Source-Available License Version 1 (SSALv1)](LICENSE.txt).

See individual files for details that specify the license applicable to each file. Files subject to the SSALv1 will be noted in their headers.
See individual files for details that specify the license applicable to each file. Files subject to the SSALv1 will be noted in their headers.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<p>This rule is deprecated, and will eventually be removed.</p>
<h2>Why is this an issue?</h2>
<p>Usage of statements, operators and keywords specific to ActionScript 2 does not allow to migrate to ActionScript 3. This includes "intrinsic"
keyword, set variable statement and following list of operators:</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
},
"attribute": "CONVENTIONAL"
},
"status": "deprecated",
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "2min"
},
"tags": [],
"tags": [
"obsolete"
],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1320",
"sqKey": "ActionScript2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<p>This rule is deprecated, and will eventually be removed.</p>
<h2>Why is this an issue?</h2>
<p>This rule template can be used to create rules which will be triggered when a comment matches a given regular expression.</p>
<p>For example, one can create a rule with the regular expression <code>.*REVIEW.*</code> to match all comment containing "REVIEW".</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"attribute": "CONVENTIONAL"
},
"status": "deprecated",
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "0min"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<p>This rule is deprecated, and will eventually be removed.</p>
<h2>Why is this an issue?</h2>
<p>Commented-out code distracts the focus from the actual executed code. It creates a noise that increases maintenance code. And because it is never
executed, it quickly becomes out of date and invalid.</p>
<p>Commented-out code should be deleted and can be retrieved from source control history if required.</p>
<p>Programmers should not comment out code as it bloats programs and reduces readability.</p>
<p>Unused code should be deleted and can be retrieved from source control history if required.</p>

Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
},
"attribute": "CLEAR"
},
"status": "deprecated",
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "5min"
},
"tags": [],
"tags": [
"unused"
],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-125",
"sqKey": "S125",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<p>This rule is deprecated, and will eventually be removed.</p>
<h2>Why is this an issue?</h2>
<p>The Cyclomatic Complexity of functions should not exceed a defined threshold. Complex code may perform poorly and can be difficult to test
thoroughly.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
},
"attribute": "FOCUSED"
},
"status": "deprecated",
"status": "ready",
"remediation": {
"func": "Linear with offset",
"linearDesc": "per complexity point above the threshold",
"linearOffset": "10min",
"linearFactor": "1min"
},
"tags": [],
"tags": [
"brain-overload"
],
"defaultSeverity": "Critical",
"ruleSpecification": "RSPEC-1541",
"sqKey": "S1541",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<p>This rule is deprecated, and will eventually be removed.</p>
<h2>Why is this an issue?</h2>
<p>This is required by IEC 61508, under good programming style.</p>
<h3>Noncompliant code example</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
},
"attribute": "CONVENTIONAL"
},
"status": "deprecated",
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "20min"
},
"tags": [],
"tags": [
"brain-overload"
],
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1005",
"sqKey": "S1005",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<p>This rule is deprecated, and will eventually be removed.</p>
<h2>Why is this an issue?</h2>
<p>Scrolling horizontally to see a full line of code lowers the code readability.</p>

Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
},
"attribute": "FORMATTED"
},
"status": "deprecated",
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "1min"
},
"tags": [],
"tags": [
"convention"
],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-103",
"sqKey": "S103",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<p>This rule is deprecated, and will eventually be removed.</p>
<h2>Why is this an issue?</h2>
<p>When the execution is not explicitly terminated at the end of a switch case, it continues to execute the statements of the following case. While
this is sometimes intentional, it often is a mistake which leads to unexpected behavior.</p>
Expand Down Expand Up @@ -49,6 +48,6 @@ <h3>Exceptions</h3>
</pre>
<h2>Resources</h2>
<ul>
<li> CWE - <a href="https://cwe.mitre.org/data/definitions/484">CWE-484 - Omitted Break Statement in Switch</a> </li>
<li> <a href="https://cwe.mitre.org/data/definitions/484">MITRE, CWE-484</a> - Omitted Break Statement in Switch </li>
</ul>

Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
},
"attribute": "CLEAR"
},
"status": "deprecated",
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "10min"
},
"tags": [],
"tags": [
"cwe",
"suspicious"
],
"defaultSeverity": "Blocker",
"ruleSpecification": "RSPEC-128",
"sqKey": "S128",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<p>This rule is deprecated, and will eventually be removed.</p>
<h2>Why is this an issue?</h2>
<p>Putting multiple statements on a single line lowers the code readability and makes debugging the code more complex.</p>
<pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
},
"attribute": "FORMATTED"
},
"status": "deprecated",
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "1min"
},
"tags": [],
"tags": [
"convention"
],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-122",
"sqKey": "S122",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<p>This rule is deprecated, and will eventually be removed.</p>
<h2>Why is this an issue?</h2>
<p>When the Flex parser fails, it is possible to record the failure as a violation on the file. This way, not only it is possible to track the number
of files that do not parse but also to easily find out why they do not parse.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"title": "Flex parser failure",
"type": "CODE_SMELL",
"status": "deprecated",
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "30min"
},
"tags": [],
"tags": [
"suspicious"
],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-2260",
"sqKey": "S2260",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<p>This rule is deprecated, and will eventually be removed.</p>
<h2>Why is this an issue?</h2>
<p>Shared naming conventions allow teams to collaborate efficiently.</p>
<p>This rule raises an issue when a function name does not match a provided regular expression.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
},
"attribute": "IDENTIFIABLE"
},
"status": "deprecated",
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "5min"
},
"tags": [],
"tags": [
"convention"
],
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-100",
"sqKey": "S100",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<p>This rule is deprecated, and will eventually be removed.</p>
<h2>Why is this an issue?</h2>
<p>Shared naming conventions allow teams to collaborate efficiently.</p>
<p>This rule raises an issue when a class name does not match a provided regular expression.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
},
"attribute": "IDENTIFIABLE"
},
"status": "deprecated",
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "5min"
},
"tags": [],
"tags": [
"convention"
],
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-101",
"sqKey": "S101",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<p>This rule is deprecated, and will eventually be removed.</p>
<h2>Why is this an issue?</h2>
<p>Nested code - blocks of code inside blocks of code - is eventually necessary, but increases complexity. This is why keeping the code as flat as
possible, by avoiding unnecessary nesting, is considered a good practice.</p>
<p>Merging <code>if</code> statements when possible will decrease the nesting of the code and improve its readability.</p>
<p>Code like</p>
<p>Merging collapsible <code>if</code> statements increases the code’s readability.</p>
<h3>Noncompliant code example</h3>
<pre>
if (condition1) {
if (condition2) { // Noncompliant
if (condition2) { // NonCompliant
...
}
}
</pre>
<p>Is more readable as</p>
<h3>Compliant solution</h3>
<pre>
if (condition1 &amp;&amp; condition2) {
...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"title": "Mergeable \"if\" statements should be combined",
"title": "Collapsible \"if\" statements should be merged",
"type": "CODE_SMELL",
"code": {
"impacts": {
"MAINTAINABILITY": "MEDIUM"
},
"attribute": "CLEAR"
},
"status": "deprecated",
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "5min"
},
"tags": [],
"tags": [
"clumsy"
],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1066",
"sqKey": "S1066",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
<p>This rule is deprecated, and will eventually be removed.</p>
<h2>Why is this an issue?</h2>
<p>If a <code>private</code> field is declared but not used locally, its limited visibility makes it dead code.</p>
<p>This is either a sign that some logic is missing or that the code should be cleaned.</p>
<p>Cleaning out dead code decreases the size of the maintained codebase, making it easier to understand and preventing bugs from being introduced.</p>
<p>If a <code>private</code> field is declared but not used in the program, it can be considered dead code and should therefore be removed. This will
improve maintainability because developers will not wonder what the variable is used for.</p>
<h3>Noncompliant code example</h3>
<pre>
public class MyClass {
private var foo:int = 4; //foo is unused

public function compute(a:int):int{
return a * 4;
}
}
</pre>
<h3>Compliant solution</h3>
<pre>
public class MyClass {
private var foo:int = 4; // Noncompliant: foo is unused and should be removed

public function compute(a:int):int{
return a * 4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
},
"attribute": "CLEAR"
},
"status": "deprecated",
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "5min"
},
"tags": [],
"tags": [
"unused"
],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1068",
"sqKey": "S1068",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<p>This rule is deprecated, and will eventually be removed.</p>
<h2>Why is this an issue?</h2>
<p>Functions with a long parameter list are difficult to use because maintainers must figure out the role of each parameter and keep track of their
<p>Functions with a long parameter list are difficult to use, as maintainers must figure out the role of each parameter and keep track of their
position.</p>
<pre>
function setCoordinates(var x1, var y1, var z1, var x2, var y2, var z2) { // Noncompliant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
},
"attribute": "FOCUSED"
},
"status": "deprecated",
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "20min"
},
"tags": [],
"tags": [
"brain-overload"
],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-107",
"sqKey": "S107",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<p>This rule is deprecated, and will eventually be removed.</p>
<h2>Why is this an issue?</h2>
<p>An empty code block is confusing. It will require some effort from maintainers to determine if it is intentional or indicates the implementation is
incomplete.</p>
Expand Down
Loading

0 comments on commit bae5be0

Please sign in to comment.