Skip to content

Commit

Permalink
Updating Rspec metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Valeri Hristov authored and valhristov committed Oct 18, 2017
1 parent 014c04d commit 6011a1e
Show file tree
Hide file tree
Showing 493 changed files with 1,124 additions and 786 deletions.
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1006_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"cert",
"pitfall"
],
"defaultSeverity": "Critical"
"defaultSeverity": "Critical",
"ruleSpecification": "RSPEC-1006"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S100_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [
"convention"
],
"defaultSeverity": "Minor"
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-100"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S101_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [
"convention"
],
"defaultSeverity": "Minor"
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-101"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S103_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [
"convention"
],
"defaultSeverity": "Major"
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-103"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S104_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [
"brain-overload"
],
"defaultSeverity": "Major"
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-104"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S105_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [
"convention"
],
"defaultSeverity": "Minor"
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-105"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1066_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [
"clumsy"
],
"defaultSeverity": "Major"
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1066"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1067_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [
"brain-overload"
],
"defaultSeverity": "Critical"
"defaultSeverity": "Critical",
"ruleSpecification": "RSPEC-1067"
}
2 changes: 1 addition & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1075_c#.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ <h2>See</h2>
<ul>
<li> <a href="https://www.securecoding.cert.org/confluence/x/qQCHAQ">CERT, MSC03-J.</a> - Never hard code sensitive information </li>
</ul>

5 changes: 3 additions & 2 deletions sonaranalyzer-dotnet/rspec/cs/S1075_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [
"cert"
],
"defaultSeverity": "Minor"
}
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1075"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S107_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [
"brain-overload"
],
"defaultSeverity": "Major"
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-107"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S108_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [
"suspicious"
],
"defaultSeverity": "Major"
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-108"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1104_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"standards": [
"CWE"
],
"defaultSeverity": "Minor"
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1104"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1109_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [
"convention"
],
"defaultSeverity": "Minor"
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1109"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S110_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"tags": [
"design"
],
"defaultSeverity": "Major"
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-110"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1116_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"cert",
"unused"
],
"defaultSeverity": "Minor"
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1116"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1117_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"cert",
"pitfall"
],
"defaultSeverity": "Major"
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1117"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1118_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [
"design"
],
"defaultSeverity": "Major"
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1118"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1121_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"standards": [
"CWE"
],
"defaultSeverity": "Major"
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1121"
}
2 changes: 1 addition & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1123_c#.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ <h2>Compliant Solution</h2>
{ ... }
}
</pre>

5 changes: 3 additions & 2 deletions sonaranalyzer-dotnet/rspec/cs/S1123_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"obsolete",
"bad-practice"
],
"defaultSeverity": "Major"
}
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1123"
}
5 changes: 3 additions & 2 deletions sonaranalyzer-dotnet/rspec/cs/S1125_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "2min"
"constantCost": "5min"
},
"tags": [
"clumsy"
],
"defaultSeverity": "Minor"
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1125"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S112_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"standards": [
"CWE"
],
"defaultSeverity": "Major"
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-112"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1134_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"standards": [
"CWE"
],
"defaultSeverity": "Major"
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1134"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1135_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"standards": [
"CWE"
],
"defaultSeverity": "Info"
"defaultSeverity": "Info",
"ruleSpecification": "RSPEC-1135"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1144_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"cert",
"unused"
],
"defaultSeverity": "Major"
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1144"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1145_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"standards": [
"CWE"
],
"defaultSeverity": "Major"
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1145"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1155_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [
"clumsy"
],
"defaultSeverity": "Minor"
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1155"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1163_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"cert",
"suspicious"
],
"defaultSeverity": "Critical"
"defaultSeverity": "Critical",
"ruleSpecification": "RSPEC-1163"
}
52 changes: 23 additions & 29 deletions sonaranalyzer-dotnet/rspec/cs/S1168_c#.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,59 @@
<p>Moreover, in many cases, <code>null</code> is used as a synonym for empty.</p>
<h2>Noncompliant Code Example</h2>
<pre>
public List&lt;Result&gt; GetResults()
{
return null; // Noncompliant
}

public Result[] GetResults()
{
return null; // Noncompliant
return null; // Noncompliant
}

public IEnumerable&lt;Result&gt; GetResults()
{
return null; // Noncompliant
return null; // Noncompliant
}

public static void Main(string[] args)
{
var results = GetResults();
public IEnumerable&lt;Result&gt; GetResults() =&gt; null; // Noncompliant

if (results != null) // Nullity test required to prevent NPE
{
for (var result in results)
public IEnumerable&lt;Result&gt; Results
{
get
{
/* ... */
return null; // Noncompliant
}
}
}

public IEnumerable&lt;Result&gt; Results =&gt; null; // Noncompliant
</pre>
<h2>Compliant Solution</h2>
<pre>
public static List&lt;Result&gt; GetResults()
public Result[] GetResults()
{
return new List&lt;Result&gt;(); // Compliant
return new Result[0];
}

public static Result[] GetResults()
public IEnumerable&lt;Result&gt; GetResults()
{
return new Result[0]; // Compliant
return Enumerable.Empty&lt;Result&gt;();
}

public static IEnumerable&lt;Result&gt; GetResults()
{
return Enumerable.Empty&lt;Result&gt;(); // Compliant
}
public IEnumerable&lt;Result&gt; GetResults() =&gt; Enumerable.Empty&lt;Result&gt;();

public static void Main(string[] args)
public IEnumerable&lt;Result&gt; Results
{
for (var result in GetResults())
{
/* ... */
}
get
{
return Enumerable.Empty&lt;Result&gt;();
}
}

public IEnumerable&lt;Result&gt; Results =&gt; Enumerable.Empty&lt;Result&gt;();
</pre>
<h2>Exceptions</h2>
<p>Although <code>string</code> is a collection, the rule won't report on it.</p>
<h2>See</h2>
<ul>
<li> <a href="https://www.securecoding.cert.org/confluence/x/AgG7AQ">CERT, MSC19-C.</a> - For functions that return an array, prefer returning an
empty array over a null value </li>
<li> <a href="https://www.securecoding.cert.org/confluence/x/zwHEAw">CERT, MET55-J.</a> - Return an empty array or collection instead of a null
value for methods that return an array or collection </li>
</ul>

5 changes: 3 additions & 2 deletions sonaranalyzer-dotnet/rspec/cs/S1168_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [
"cert"
],
"defaultSeverity": "Major"
}
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1168"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1172_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"cert",
"unused"
],
"defaultSeverity": "Major"
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1172"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1185_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"redundant",
"clumsy"
],
"defaultSeverity": "Minor"
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1185"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1186_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [
"suspicious"
],
"defaultSeverity": "Critical"
"defaultSeverity": "Critical",
"ruleSpecification": "RSPEC-1186"
}
2 changes: 1 addition & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1200_c#.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ <h2>Noncompliant Code Example</h2>
}
}
</pre>

5 changes: 3 additions & 2 deletions sonaranalyzer-dotnet/rspec/cs/S1200_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [
"brain-overload"
],
"defaultSeverity": "Major"
}
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1200"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1206_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"standards": [
"CWE"
],
"defaultSeverity": "Minor"
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1206"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1210_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"tags": [

],
"defaultSeverity": "Minor"
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1210"
}
3 changes: 2 additions & 1 deletion sonaranalyzer-dotnet/rspec/cs/S1215_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"unpredictable",
"bad-practice"
],
"defaultSeverity": "Critical"
"defaultSeverity": "Critical",
"ruleSpecification": "RSPEC-1215"
}
Loading

0 comments on commit 6011a1e

Please sign in to comment.