Skip to content

Commit

Permalink
Deploying to gh-pages from @ 9ce6835 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
gregory-paidis-sonarsource committed Apr 12, 2024
1 parent aa8dccc commit 22d3d0d
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 11 deletions.
11 changes: 7 additions & 4 deletions rules/S6968/csharp-description.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h2 id="_description">Description</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In an <a href="https://learn.microsoft.com/en-us/aspnet/core">ASP.NET Core</a> <a href="https://en.wikipedia.org/wiki/Web_API">Web API</a>, controller actions can optionally return a result value. If a controller action returns a value in the <a href="https://en.wikipedia.org/wiki/Happy_path">happy path</a>, annotating the action with one of the <a href="https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.producesresponsetypeattribute"><code>[ProducesResponseType]</code></a> overloads that describe the type is recommended.</p>
<p>In an <a href="https://learn.microsoft.com/en-us/aspnet/core">ASP.NET Core</a> <a href="https://en.wikipedia.org/wiki/Web_API">Web API</a>, controller actions can optionally return a result value. If a controller action returns a value in the <a href="https://en.wikipedia.org/wiki/Happy_path">happy path</a>, for example <a href="https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.controllerbase.ok#microsoft-aspnetcore-mvc-controllerbase-ok(system-object)">ControllerBase.Ok(Object)</a>, annotating the action with one of the <a href="https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.producesresponsetypeattribute"><code>[ProducesResponseType]</code></a> overloads that describe the type is recommended.</p>
</div>
</div>
</div>
Expand Down Expand Up @@ -88,7 +88,7 @@ <h4 id="_noncompliant_code_example">Noncompliant code example</h4>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-csharp" data-lang="csharp">[HttpGet("foo")]
// Noncompliant: Annotate this method with ProducesResponseType containing the return type for succesful responses.
// Noncompliant: Use the ProducesResponseType overload containing the return type for succesful responses.
[ProducesResponseType(StatusCodes.Status200OK)]
public IActionResult MagicNumber() =&gt; Ok(42);</code></pre>
</div>
Expand Down Expand Up @@ -173,7 +173,10 @@ <h3 id="_message">Message</h3>
<div class="ulist">
<ul>
<li>
<p>Annotate this method with ProducesResponseType containing the return type for successful responses.</p>
<p>If no <code>ProducesResponseType</code> is specified: Annotate this method with ProducesResponseType containing the return type for successful responses.</p>
</li>
<li>
<p>If a type-less <code>ProducesResponseType</code> is specified: Use the ProducesResponseType overload containing the return type for successful responses.</p>
</li>
</ul>
</div>
Expand All @@ -186,7 +189,7 @@ <h3 id="_highlighting">Highlighting</h3>
<p>Primary: The identifier of the action method.</p>
</li>
<li>
<p>Secondary: The returned expression of the success path.</p>
<p>Secondary: The returned expression of the success path that contains a value.</p>
</li>
</ul>
</div>
Expand Down
11 changes: 7 additions & 4 deletions rules/S6968/default-description.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h2 id="_description">Description</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In an <a href="https://learn.microsoft.com/en-us/aspnet/core">ASP.NET Core</a> <a href="https://en.wikipedia.org/wiki/Web_API">Web API</a>, controller actions can optionally return a result value. If a controller action returns a value in the <a href="https://en.wikipedia.org/wiki/Happy_path">happy path</a>, annotating the action with one of the <a href="https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.producesresponsetypeattribute"><code>[ProducesResponseType]</code></a> overloads that describe the type is recommended.</p>
<p>In an <a href="https://learn.microsoft.com/en-us/aspnet/core">ASP.NET Core</a> <a href="https://en.wikipedia.org/wiki/Web_API">Web API</a>, controller actions can optionally return a result value. If a controller action returns a value in the <a href="https://en.wikipedia.org/wiki/Happy_path">happy path</a>, for example <a href="https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.controllerbase.ok#microsoft-aspnetcore-mvc-controllerbase-ok(system-object)">ControllerBase.Ok(Object)</a>, annotating the action with one of the <a href="https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.producesresponsetypeattribute"><code>[ProducesResponseType]</code></a> overloads that describe the type is recommended.</p>
</div>
</div>
</div>
Expand Down Expand Up @@ -88,7 +88,7 @@ <h4 id="_noncompliant_code_example">Noncompliant code example</h4>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-csharp" data-lang="csharp">[HttpGet("foo")]
// Noncompliant: Annotate this method with ProducesResponseType containing the return type for succesful responses.
// Noncompliant: Use the ProducesResponseType overload containing the return type for succesful responses.
[ProducesResponseType(StatusCodes.Status200OK)]
public IActionResult MagicNumber() =&gt; Ok(42);</code></pre>
</div>
Expand Down Expand Up @@ -173,7 +173,10 @@ <h3 id="_message">Message</h3>
<div class="ulist">
<ul>
<li>
<p>Annotate this method with ProducesResponseType containing the return type for successful responses.</p>
<p>If no <code>ProducesResponseType</code> is specified: Annotate this method with ProducesResponseType containing the return type for successful responses.</p>
</li>
<li>
<p>If a type-less <code>ProducesResponseType</code> is specified: Use the ProducesResponseType overload containing the return type for successful responses.</p>
</li>
</ul>
</div>
Expand All @@ -186,7 +189,7 @@ <h3 id="_highlighting">Highlighting</h3>
<p>Primary: The identifier of the action method.</p>
</li>
<li>
<p>Secondary: The returned expression of the success path.</p>
<p>Secondary: The returned expression of the success path that contains a value.</p>
</li>
</ul>
</div>
Expand Down
40 changes: 40 additions & 0 deletions rules/S6970/default-description.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<div class="sect1">
<h2 id="_description">Description</h2>
<div class="sectionbody">
<div class="paragraph">
<p>FIXME: add a description</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_why_is_this_an_issue">Why is this an issue?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>FIXME: remove the unused optional headers (that are commented out)</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_how_to_fix_it">How to fix it</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_code_examples">Code examples</h3>
<div class="sect3">
<h4 id="_noncompliant_code_example">Noncompliant code example</h4>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-text" data-lang="text">FIXME</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_compliant_solution">Compliant solution</h4>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-text" data-lang="text">FIXME</code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
1 change: 1 addition & 0 deletions rules/S6970/default-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"title":"FIXME","type":"CODE_SMELL","status":"ready","remediation":{"func":"Constant/Issue","constantCost":"5min"},"tags":[],"defaultSeverity":"Major","ruleSpecification":"RSPEC-6970","sqKey":"S6970","scope":"All","defaultQualityProfiles":["Sonar way"],"quickfix":"unknown","code":{"impacts":{"MAINTAINABILITY":"HIGH","RELIABILITY":"MEDIUM","SECURITY":"LOW"},"attribute":"CONVENTIONAL"},"allKeys":["S6970"],"prUrl":"https://github.com/SonarSource/rspec/pull/3869","branch":"rule/add-RSPEC-S6970","languagesSupport":[{"name":"python","status":"ready"}]}
40 changes: 40 additions & 0 deletions rules/S6970/python-description.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<div class="sect1">
<h2 id="_description">Description</h2>
<div class="sectionbody">
<div class="paragraph">
<p>FIXME: add a description</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_why_is_this_an_issue">Why is this an issue?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>FIXME: remove the unused optional headers (that are commented out)</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_how_to_fix_it">How to fix it</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_code_examples">Code examples</h3>
<div class="sect3">
<h4 id="_noncompliant_code_example">Noncompliant code example</h4>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-text" data-lang="text">FIXME</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_compliant_solution">Compliant solution</h4>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-text" data-lang="text">FIXME</code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
1 change: 1 addition & 0 deletions rules/S6970/python-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"title":"FIXME","type":"CODE_SMELL","status":"ready","remediation":{"func":"Constant/Issue","constantCost":"5min"},"tags":[],"defaultSeverity":"Major","ruleSpecification":"RSPEC-6970","sqKey":"S6970","scope":"All","defaultQualityProfiles":["Sonar way"],"quickfix":"unknown","code":{"impacts":{"MAINTAINABILITY":"HIGH","RELIABILITY":"MEDIUM","SECURITY":"LOW"},"attribute":"CONVENTIONAL"},"allKeys":["S6970"],"prUrl":"https://github.com/SonarSource/rspec/pull/3869","branch":"rule/add-RSPEC-S6970","languagesSupport":[{"name":"python","status":"ready"}]}
2 changes: 1 addition & 1 deletion rules/rule-index-aggregates.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"langs":{"abap":123,"apex":70,"cfamily":898,"csharp":589,"default":3512,"flex":100,"go":56,"java":970,"javascript":549,"jcl":19,"kotlin":158,"php":326,"python":410,"rpg":94,"ruby":42,"scala":43,"swift":149,"plsql":216,"vbnet":263,"html":103,"pli":34,"tsql":86,"vb6":65,"xml":60,"cobol":225,"css":28,"azureresourcemanager":31,"cloudformation":28,"docker":35,"kubernetes":24,"terraform":51,"secrets":63,"text":1},"tags":{"convention":207,"cert":300,"misra-c++2008":59,"pitfall":306,"based-on-misra":206,"cppcoreguidelines":86,"suspicious":174,"brain-overload":84,"misra":28,"bad-practice":126,"unused":84,"clumsy":179,"lock-in":49,"cwe":370,"error-handling":62,"psr2":8,"error-reporting":3,"user-experience":26,"sql":103,"obsolete":58,"android":26,"accessibility":48,"react":72,"wcag2-a":10,"injection":1,"html5":5,"cross-browser":4,"design":49,"bug":37,"confusing":131,"unpredictable":44,"es2015":22,"type-dependent":72,"redundant":25,"performance":191,"since-c++11":60,"multi-threading":55,"leak":16,"denial-of-service":16,"symbolic-execution":62,"microfocus":1,"logging":15,"jsp-jsf":6,"preprocessor":11,"java8":24,"tests":65,"junit":23,"phpunit":12,"security":5,"python3":10,"psr1":3,"per":2,"finding":12,"i18n":1,"serialization":18,"hibernate":9,"spring":47,"express.js":17,"privacy":13,"api-design":31,"singleton":1,"AWS":1,"overflow":3,"jasmine":1,"jest":1,"mocha":4,"node":1,"struts":4,"misra-c2012":12,"backbone":3,"misra-c2004":19,"docker":2,"angularjs":1,"ejb":3,"jee":6,"chai":5,"jquery":1,"assertj":7,"mockito":5,"msvc":1,"swing":1,"deadlock":3,"async-await":8,"php-ini":6,"maven":9,"since-c++14":5,"c11":1,"gnu":3,"xsd":18,"localisation":4,"duplicate":1,"mef":3,"winforms":1,"event":1,"regex":39,"wpf":1,"xaml":1,"proficiency":5,"aws":33,"azure":24,"gcp":20,"rules":1,"antipattern":1,"jsx":8,"yield":1,"django":1,"flask":1,"debug":1,"java7":1,"guava":1,"java9":2,"full-project":3,"ssl":2,"phishing":1,"java14":6,"dockerfile":11,"governor-limits":5,"since-c++17":23,"unittest":1,"java15":1,"since-c++20":65,"java16":12,"java10":1,"java17":1,"startup-time":2,"coroutines":12,"cwe-284":1,"javadoc":12,"java18":9,"floating-point":1,"numbers":1,"precision":1,"architecture":4,"async":1,"promise":1,"sans-top25-insecure":1,"enum":2,"object":1,"string":1,"shell":1,"assertion":1,"function":1,"type":1,"es2020":1,"nullish-coalescing":1,"rspec-showcase":3,"Gradle":2,"gradle":10,"es2022":1,"es2018":1,"jspecify":1,"nullability":1,"data-science":19,"numpy":12,"pandas":8,"blazor":9,"paths":1,"best-practice":1,"java21":15,"sustainability":10,"java":1,"jpa":1,"susceptibility":1,"asp.net":9,"assembler":1},"qualityProfiles":{"Sonar way":2346,"Drupal":1}}
{"langs":{"abap":123,"apex":70,"cfamily":898,"csharp":589,"default":3513,"flex":100,"go":56,"java":970,"javascript":549,"jcl":19,"kotlin":158,"php":326,"python":411,"rpg":94,"ruby":42,"scala":43,"swift":149,"plsql":216,"vbnet":263,"html":103,"pli":34,"tsql":86,"vb6":65,"xml":60,"cobol":225,"css":28,"azureresourcemanager":31,"cloudformation":28,"docker":35,"kubernetes":24,"terraform":51,"secrets":63,"text":1},"tags":{"convention":207,"cert":300,"misra-c++2008":59,"pitfall":306,"based-on-misra":206,"cppcoreguidelines":86,"suspicious":174,"brain-overload":84,"misra":28,"bad-practice":126,"unused":84,"clumsy":179,"lock-in":49,"cwe":370,"error-handling":62,"psr2":8,"error-reporting":3,"user-experience":26,"sql":103,"obsolete":58,"android":26,"accessibility":48,"react":72,"wcag2-a":10,"injection":1,"html5":5,"cross-browser":4,"design":49,"bug":37,"confusing":131,"unpredictable":44,"es2015":22,"type-dependent":72,"redundant":25,"performance":191,"since-c++11":60,"multi-threading":55,"leak":16,"denial-of-service":16,"symbolic-execution":62,"microfocus":1,"logging":15,"jsp-jsf":6,"preprocessor":11,"java8":24,"tests":65,"junit":23,"phpunit":12,"security":5,"python3":10,"psr1":3,"per":2,"finding":12,"i18n":1,"serialization":18,"hibernate":9,"spring":47,"express.js":17,"privacy":13,"api-design":31,"singleton":1,"AWS":1,"overflow":3,"jasmine":1,"jest":1,"mocha":4,"node":1,"struts":4,"misra-c2012":12,"backbone":3,"misra-c2004":19,"docker":2,"angularjs":1,"ejb":3,"jee":6,"chai":5,"jquery":1,"assertj":7,"mockito":5,"msvc":1,"swing":1,"deadlock":3,"async-await":8,"php-ini":6,"maven":9,"since-c++14":5,"c11":1,"gnu":3,"xsd":18,"localisation":4,"duplicate":1,"mef":3,"winforms":1,"event":1,"regex":39,"wpf":1,"xaml":1,"proficiency":5,"aws":33,"azure":24,"gcp":20,"rules":1,"antipattern":1,"jsx":8,"yield":1,"django":1,"flask":1,"debug":1,"java7":1,"guava":1,"java9":2,"full-project":3,"ssl":2,"phishing":1,"java14":6,"dockerfile":11,"governor-limits":5,"since-c++17":23,"unittest":1,"java15":1,"since-c++20":65,"java16":12,"java10":1,"java17":1,"startup-time":2,"coroutines":12,"cwe-284":1,"javadoc":12,"java18":9,"floating-point":1,"numbers":1,"precision":1,"architecture":4,"async":1,"promise":1,"sans-top25-insecure":1,"enum":2,"object":1,"string":1,"shell":1,"assertion":1,"function":1,"type":1,"es2020":1,"nullish-coalescing":1,"rspec-showcase":3,"Gradle":2,"gradle":10,"es2022":1,"es2018":1,"jspecify":1,"nullability":1,"data-science":19,"numpy":12,"pandas":8,"blazor":9,"paths":1,"best-practice":1,"java21":15,"sustainability":10,"java":1,"jpa":1,"susceptibility":1,"asp.net":9,"assembler":1},"qualityProfiles":{"Sonar way":2347,"Drupal":1}}
2 changes: 1 addition & 1 deletion rules/rule-index-store.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion rules/rule-index.json

Large diffs are not rendered by default.

0 comments on commit 22d3d0d

Please sign in to comment.