Skip to content

Commit

Permalink
Deploying to gh-pages from @ f193e8a 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-wielage-sonarsource committed Mar 20, 2024
1 parent 2c8571f commit bf2ff3c
Show file tree
Hide file tree
Showing 27 changed files with 151 additions and 169 deletions.
10 changes: 5 additions & 5 deletions rules/S1481/abap-description.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ <h3 id="_what_is_the_potential_impact">What is the potential impact?</h3>
<div class="ulist">
<ul>
<li>
<p>Decreased Readability: Unused variables can make your code more difficult to read. They add extra lines and complexity, which can distract from the main logic of the code.</p>
<p><strong>Decreased Readability</strong>: Unused variables can make your code more difficult to read. They add extra lines and complexity, which can distract from the main logic of the code.</p>
</li>
<li>
<p>Misunderstanding: When other developers read your code, they may wonder why a variable is declared but not used. This can lead to confusion and misinterpretation of the code&#8217;s intent.</p>
<p><strong>Misunderstanding</strong>: When other developers read your code, they may wonder why a variable is declared but not used. This can lead to confusion and misinterpretation of the code&#8217;s intent.</p>
</li>
<li>
<p>Potential for Bugs: If a variable is declared but not used, it might indicate a bug or incomplete code. For example, if you declared a variable intending to use it in a calculation, but then forgot to do so, your program might not work as expected.</p>
<p><strong>Potential for Bugs</strong>: If a variable is declared but not used, it might indicate a bug or incomplete code. For example, if you declared a variable intending to use it in a calculation, but then forgot to do so, your program might not work as expected.</p>
</li>
<li>
<p>Maintenance Issues: Unused variables can make code maintenance more difficult. If a programmer sees an unused variable, they might think it is a mistake and try to 'fix' the code, potentially introducing new bugs.</p>
<p><strong>Maintenance Issues</strong>: Unused variables can make code maintenance more difficult. If a programmer sees an unused variable, they might think it is a mistake and try to 'fix' the code, potentially introducing new bugs.</p>
</li>
<li>
<p>Memory Usage: Although modern compilers are smart enough to ignore unused variables, not all compilers do this. In such cases, unused variables take up memory space, leading to inefficient use of resources.</p>
<p><strong>Memory Usage</strong>: Although modern compilers are smart enough to ignore unused variables, not all compilers do this. In such cases, unused variables take up memory space, leading to inefficient use of resources.</p>
</li>
</ul>
</div>
Expand Down
10 changes: 5 additions & 5 deletions rules/S1481/apex-description.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ <h3 id="_what_is_the_potential_impact">What is the potential impact?</h3>
<div class="ulist">
<ul>
<li>
<p>Decreased Readability: Unused variables can make your code more difficult to read. They add extra lines and complexity, which can distract from the main logic of the code.</p>
<p><strong>Decreased Readability</strong>: Unused variables can make your code more difficult to read. They add extra lines and complexity, which can distract from the main logic of the code.</p>
</li>
<li>
<p>Misunderstanding: When other developers read your code, they may wonder why a variable is declared but not used. This can lead to confusion and misinterpretation of the code&#8217;s intent.</p>
<p><strong>Misunderstanding</strong>: When other developers read your code, they may wonder why a variable is declared but not used. This can lead to confusion and misinterpretation of the code&#8217;s intent.</p>
</li>
<li>
<p>Potential for Bugs: If a variable is declared but not used, it might indicate a bug or incomplete code. For example, if you declared a variable intending to use it in a calculation, but then forgot to do so, your program might not work as expected.</p>
<p><strong>Potential for Bugs</strong>: If a variable is declared but not used, it might indicate a bug or incomplete code. For example, if you declared a variable intending to use it in a calculation, but then forgot to do so, your program might not work as expected.</p>
</li>
<li>
<p>Maintenance Issues: Unused variables can make code maintenance more difficult. If a programmer sees an unused variable, they might think it is a mistake and try to 'fix' the code, potentially introducing new bugs.</p>
<p><strong>Maintenance Issues</strong>: Unused variables can make code maintenance more difficult. If a programmer sees an unused variable, they might think it is a mistake and try to 'fix' the code, potentially introducing new bugs.</p>
</li>
<li>
<p>Memory Usage: Although modern compilers are smart enough to ignore unused variables, not all compilers do this. In such cases, unused variables take up memory space, leading to inefficient use of resources.</p>
<p><strong>Memory Usage</strong>: Although modern compilers are smart enough to ignore unused variables, not all compilers do this. In such cases, unused variables take up memory space, leading to inefficient use of resources.</p>
</li>
</ul>
</div>
Expand Down
26 changes: 14 additions & 12 deletions rules/S1481/azureresourcemanager-description.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ <h3 id="_what_is_the_potential_impact">What is the potential impact?</h3>
<div class="ulist">
<ul>
<li>
<p>Decreased Readability: Unused variables can make your code more difficult to read. They add extra lines and complexity, which can distract from the main logic of the code.</p>
<p><strong>Decreased Readability</strong>: Unused variables can make your code more difficult to read. They add extra lines and complexity, which can distract from the main logic of the code.</p>
</li>
<li>
<p>Misunderstanding: When other developers read your code, they may wonder why a variable is declared but not used. This can lead to confusion and misinterpretation of the code&#8217;s intent.</p>
<p><strong>Misunderstanding</strong>: When other developers read your code, they may wonder why a variable is declared but not used. This can lead to confusion and misinterpretation of the code&#8217;s intent.</p>
</li>
<li>
<p>Potential for Bugs: If a variable is declared but not used, it might indicate a bug or incomplete code. For example, if you declared a variable intending to use it in a calculation, but then forgot to do so, your program might not work as expected.</p>
<p><strong>Potential for Bugs</strong>: If a variable is declared but not used, it might indicate a bug or incomplete code. For example, if you declared a variable intending to use it in a calculation, but then forgot to do so, your program might not work as expected.</p>
</li>
<li>
<p>Maintenance Issues: Unused variables can make code maintenance more difficult. If a programmer sees an unused variable, they might think it is a mistake and try to 'fix' the code, potentially introducing new bugs.</p>
<p><strong>Maintenance Issues</strong>: Unused variables can make code maintenance more difficult. If a programmer sees an unused variable, they might think it is a mistake and try to 'fix' the code, potentially introducing new bugs.</p>
</li>
<li>
<p>Memory Usage: Although modern compilers are smart enough to ignore unused variables, not all compilers do this. In such cases, unused variables take up memory space, leading to inefficient use of resources.</p>
<p><strong>Memory Usage</strong>: Although modern compilers are smart enough to ignore unused variables, not all compilers do this. In such cases, unused variables take up memory space, leading to inefficient use of resources.</p>
</li>
</ul>
</div>
Expand All @@ -44,7 +44,8 @@ <h3 id="_what_is_the_potential_impact">What is the potential impact?</h3>
<h2 id="_how_to_fix_it_in_arm_templates">How to fix it in ARM Templates</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Remove the unused variable, after ensuring it is not part of an incomplete implementation leading to bugs.</p>
<p>The fix for this issue is straightforward.
Once you ensure the unused variable is not part of an incomplete implementation leading to bugs, you just need to remove it.</p>
</div>
<div class="sect2">
<h3 id="_code_examples">Code examples</h3>
Expand All @@ -55,8 +56,8 @@ <h4 id="_noncompliant_code_example">Noncompliant code example</h4>
<pre class="highlight"><code class="language-json" data-lang="json">{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"variables": {
"virtualMachinesName": "[concat('virtualMachinesResource', uniqueString(resourceGroup().id))]",
"unusedVariable": "unusedValue"
"unusedVariable": "unusedValue",
"virtualMachinesName": "[uniqueString(resourceGroup().id)]"
},
"resources": [
{
Expand All @@ -77,7 +78,7 @@ <h4 id="_compliant_solution">Compliant solution</h4>
<pre class="highlight"><code class="language-json" data-lang="json">{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"variables": {
"virtualMachinesName": "[concat('virtualMachinesResource', uniqueString(resourceGroup().id))]"
"virtualMachinesName": "[uniqueString(resourceGroup().id)]"
},
"resources": [
{
Expand All @@ -98,16 +99,17 @@ <h4 id="_compliant_solution">Compliant solution</h4>
<h2 id="_how_to_fix_it_in_bicep">How to fix it in Bicep</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Remove the unused variable, after ensuring it is not part of an incomplete implementation leading to bugs.</p>
<p>The fix for this issue is straightforward.
Once you ensure the unused variable is not part of an incomplete implementation leading to bugs, you just need to remove it.</p>
</div>
<div class="sect2">
<h3 id="_code_examples_2">Code examples</h3>
<div class="sect3">
<h4 id="_noncompliant_code_example_2">Noncompliant code example</h4>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bicep" data-lang="bicep">var storageName = '${toLower(storageNamePrefix)}${uniqueString(resourceGroup().id)}'
var unusedVariable = 'unusedValue' # Noncompliant
<pre class="highlight"><code class="language-bicep" data-lang="bicep">var unusedVariable = 'unusedValue' # Noncompliant
var virtualMachinesName = '${uniqueString(resourceGroup().id)}'

resource demoAccount 'Microsoft.Compute/virtualMachines@2023-09-01' = {
name: virtualMachinesName
Expand Down
10 changes: 5 additions & 5 deletions rules/S1481/cfamily-description.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ <h3 id="_what_is_the_potential_impact">What is the potential impact?</h3>
<div class="ulist">
<ul>
<li>
<p>Decreased Readability: Unused variables can make your code more difficult to read. They add extra lines and complexity, which can distract from the main logic of the code.</p>
<p><strong>Decreased Readability</strong>: Unused variables can make your code more difficult to read. They add extra lines and complexity, which can distract from the main logic of the code.</p>
</li>
<li>
<p>Misunderstanding: When other developers read your code, they may wonder why a variable is declared but not used. This can lead to confusion and misinterpretation of the code&#8217;s intent.</p>
<p><strong>Misunderstanding</strong>: When other developers read your code, they may wonder why a variable is declared but not used. This can lead to confusion and misinterpretation of the code&#8217;s intent.</p>
</li>
<li>
<p>Potential for Bugs: If a variable is declared but not used, it might indicate a bug or incomplete code. For example, if you declared a variable intending to use it in a calculation, but then forgot to do so, your program might not work as expected.</p>
<p><strong>Potential for Bugs</strong>: If a variable is declared but not used, it might indicate a bug or incomplete code. For example, if you declared a variable intending to use it in a calculation, but then forgot to do so, your program might not work as expected.</p>
</li>
<li>
<p>Maintenance Issues: Unused variables can make code maintenance more difficult. If a programmer sees an unused variable, they might think it is a mistake and try to 'fix' the code, potentially introducing new bugs.</p>
<p><strong>Maintenance Issues</strong>: Unused variables can make code maintenance more difficult. If a programmer sees an unused variable, they might think it is a mistake and try to 'fix' the code, potentially introducing new bugs.</p>
</li>
<li>
<p>Memory Usage: Although modern compilers are smart enough to ignore unused variables, not all compilers do this. In such cases, unused variables take up memory space, leading to inefficient use of resources.</p>
<p><strong>Memory Usage</strong>: Although modern compilers are smart enough to ignore unused variables, not all compilers do this. In such cases, unused variables take up memory space, leading to inefficient use of resources.</p>
</li>
</ul>
</div>
Expand Down
10 changes: 5 additions & 5 deletions rules/S1481/csharp-description.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ <h3 id="_what_is_the_potential_impact">What is the potential impact?</h3>
<div class="ulist">
<ul>
<li>
<p>Decreased Readability: Unused variables can make your code more difficult to read. They add extra lines and complexity, which can distract from the main logic of the code.</p>
<p><strong>Decreased Readability</strong>: Unused variables can make your code more difficult to read. They add extra lines and complexity, which can distract from the main logic of the code.</p>
</li>
<li>
<p>Misunderstanding: When other developers read your code, they may wonder why a variable is declared but not used. This can lead to confusion and misinterpretation of the code&#8217;s intent.</p>
<p><strong>Misunderstanding</strong>: When other developers read your code, they may wonder why a variable is declared but not used. This can lead to confusion and misinterpretation of the code&#8217;s intent.</p>
</li>
<li>
<p>Potential for Bugs: If a variable is declared but not used, it might indicate a bug or incomplete code. For example, if you declared a variable intending to use it in a calculation, but then forgot to do so, your program might not work as expected.</p>
<p><strong>Potential for Bugs</strong>: If a variable is declared but not used, it might indicate a bug or incomplete code. For example, if you declared a variable intending to use it in a calculation, but then forgot to do so, your program might not work as expected.</p>
</li>
<li>
<p>Maintenance Issues: Unused variables can make code maintenance more difficult. If a programmer sees an unused variable, they might think it is a mistake and try to 'fix' the code, potentially introducing new bugs.</p>
<p><strong>Maintenance Issues</strong>: Unused variables can make code maintenance more difficult. If a programmer sees an unused variable, they might think it is a mistake and try to 'fix' the code, potentially introducing new bugs.</p>
</li>
<li>
<p>Memory Usage: Although modern compilers are smart enough to ignore unused variables, not all compilers do this. In such cases, unused variables take up memory space, leading to inefficient use of resources.</p>
<p><strong>Memory Usage</strong>: Although modern compilers are smart enough to ignore unused variables, not all compilers do this. In such cases, unused variables take up memory space, leading to inefficient use of resources.</p>
</li>
</ul>
</div>
Expand Down
10 changes: 5 additions & 5 deletions rules/S1481/default-description.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ <h3 id="_what_is_the_potential_impact">What is the potential impact?</h3>
<div class="ulist">
<ul>
<li>
<p>Decreased Readability: Unused variables can make your code more difficult to read. They add extra lines and complexity, which can distract from the main logic of the code.</p>
<p><strong>Decreased Readability</strong>: Unused variables can make your code more difficult to read. They add extra lines and complexity, which can distract from the main logic of the code.</p>
</li>
<li>
<p>Misunderstanding: When other developers read your code, they may wonder why a variable is declared but not used. This can lead to confusion and misinterpretation of the code&#8217;s intent.</p>
<p><strong>Misunderstanding</strong>: When other developers read your code, they may wonder why a variable is declared but not used. This can lead to confusion and misinterpretation of the code&#8217;s intent.</p>
</li>
<li>
<p>Potential for Bugs: If a variable is declared but not used, it might indicate a bug or incomplete code. For example, if you declared a variable intending to use it in a calculation, but then forgot to do so, your program might not work as expected.</p>
<p><strong>Potential for Bugs</strong>: If a variable is declared but not used, it might indicate a bug or incomplete code. For example, if you declared a variable intending to use it in a calculation, but then forgot to do so, your program might not work as expected.</p>
</li>
<li>
<p>Maintenance Issues: Unused variables can make code maintenance more difficult. If a programmer sees an unused variable, they might think it is a mistake and try to 'fix' the code, potentially introducing new bugs.</p>
<p><strong>Maintenance Issues</strong>: Unused variables can make code maintenance more difficult. If a programmer sees an unused variable, they might think it is a mistake and try to 'fix' the code, potentially introducing new bugs.</p>
</li>
<li>
<p>Memory Usage: Although modern compilers are smart enough to ignore unused variables, not all compilers do this. In such cases, unused variables take up memory space, leading to inefficient use of resources.</p>
<p><strong>Memory Usage</strong>: Although modern compilers are smart enough to ignore unused variables, not all compilers do this. In such cases, unused variables take up memory space, leading to inefficient use of resources.</p>
</li>
</ul>
</div>
Expand Down
10 changes: 5 additions & 5 deletions rules/S1481/flex-description.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ <h3 id="_what_is_the_potential_impact">What is the potential impact?</h3>
<div class="ulist">
<ul>
<li>
<p>Decreased Readability: Unused variables can make your code more difficult to read. They add extra lines and complexity, which can distract from the main logic of the code.</p>
<p><strong>Decreased Readability</strong>: Unused variables can make your code more difficult to read. They add extra lines and complexity, which can distract from the main logic of the code.</p>
</li>
<li>
<p>Misunderstanding: When other developers read your code, they may wonder why a variable is declared but not used. This can lead to confusion and misinterpretation of the code&#8217;s intent.</p>
<p><strong>Misunderstanding</strong>: When other developers read your code, they may wonder why a variable is declared but not used. This can lead to confusion and misinterpretation of the code&#8217;s intent.</p>
</li>
<li>
<p>Potential for Bugs: If a variable is declared but not used, it might indicate a bug or incomplete code. For example, if you declared a variable intending to use it in a calculation, but then forgot to do so, your program might not work as expected.</p>
<p><strong>Potential for Bugs</strong>: If a variable is declared but not used, it might indicate a bug or incomplete code. For example, if you declared a variable intending to use it in a calculation, but then forgot to do so, your program might not work as expected.</p>
</li>
<li>
<p>Maintenance Issues: Unused variables can make code maintenance more difficult. If a programmer sees an unused variable, they might think it is a mistake and try to 'fix' the code, potentially introducing new bugs.</p>
<p><strong>Maintenance Issues</strong>: Unused variables can make code maintenance more difficult. If a programmer sees an unused variable, they might think it is a mistake and try to 'fix' the code, potentially introducing new bugs.</p>
</li>
<li>
<p>Memory Usage: Although modern compilers are smart enough to ignore unused variables, not all compilers do this. In such cases, unused variables take up memory space, leading to inefficient use of resources.</p>
<p><strong>Memory Usage</strong>: Although modern compilers are smart enough to ignore unused variables, not all compilers do this. In such cases, unused variables take up memory space, leading to inefficient use of resources.</p>
</li>
</ul>
</div>
Expand Down
Loading

0 comments on commit bf2ff3c

Please sign in to comment.