-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SONARFLEX-173 Update rule metadata with clean code taxonomy attributes
- Loading branch information
Showing
76 changed files
with
456 additions
and
30 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/ActionScript2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/CommentRegularExpression.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/CommentedCode.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/FunctionComplexity.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/FunctionSinglePointOfExit.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/LineLength.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/NonEmptyCaseWithoutBreak.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/OneStatementPerLine.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/OneStatementPerLine.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/S100.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/S101.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/S1066.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/S1068.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 30 additions & 9 deletions
39
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/S107.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,38 @@ | ||
<h2>Why is this an issue?</h2> | ||
<p>A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many | ||
things.</p> | ||
<h3>Noncompliant code example</h3> | ||
<p>With a maximum number of 4 parameters:</p> | ||
<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> | ||
public function addData(p1 : int, p2 : int, p3 : int, p4 : int, p5 : int): void { | ||
... | ||
function setCoordinates(var x1, var y1, var z1, var x2, var y2, var z2) { // Noncompliant | ||
// ... | ||
} | ||
</pre> | ||
<h3>Compliant solution</h3> | ||
<p>The solution can be to:</p> | ||
<ul> | ||
<li> Split the function into smaller ones </li> | ||
</ul> | ||
<pre> | ||
public function addData(p1 : int, p2 : int, p3 : int, p4 : int): void { | ||
... | ||
// Each function does a part of what the original setCoordinates function was doing, so confusion risks are lower | ||
void setOrigin(var x, var y, var z) { | ||
// ... | ||
} | ||
|
||
void setSize(var width, var height, var depth) { | ||
// ... | ||
} | ||
</pre> | ||
<ul> | ||
<li> Find a better data structure for the parameters that group data in a way that makes sense for the specific application domain </li> | ||
</ul> | ||
<pre> | ||
struct Point { // In geometry, Point is a logical structure to group data | ||
var x; | ||
var y; | ||
var z; | ||
}; | ||
|
||
function setCoordinates(var p1, var p2) { | ||
// ... | ||
} | ||
</pre> | ||
<p>This rule raises an issue when a function has more parameters than the provided threshold.</p> | ||
|
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/S107.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/S108.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/S1116.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/S1117.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/S1117.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/S1125.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/S1142.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/S1144.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/S115.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/S1151.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
flex-checks/src/main/resources/org/sonar/l10n/flex/rules/flex/S116.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.