-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ 38ffd02 🚀
- Loading branch information
1 parent
91602dc
commit 766abf0
Showing
8 changed files
with
84 additions
and
80 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"title":"\"Option Explicit\" should be enabled","type":"CODE_SMELL","code":{"impacts":{"MAINTAINABILITY":"HIGH"},"attribute":"COMPLETE"},"status":"ready","remediation":{"func":"Constant/Issue","constantCost":"3h"},"tags":["bad-practice"],"extra":{"replacementRules":[],"legacyKeys":[]},"defaultSeverity":"Critical","ruleSpecification":"RSPEC-6146","sqKey":"S6146","scope":"All","defaultQualityProfiles":["Sonar way"],"quickfix":"unknown","allKeys":["S6146"],"branch":"master","languagesSupport":[{"name":"vbnet","status":"ready"}]} | ||
{"title":"\"Option Explicit\" should be enabled","type":"CODE_SMELL","code":{"impacts":{"MAINTAINABILITY":"HIGH"},"attribute":"COMPLETE"},"status":"ready","remediation":{"func":"Constant/Issue","constantCost":"3h"},"tags":["bad-practice"],"extra":{"replacementRules":[],"legacyKeys":[]},"defaultSeverity":"Critical","ruleSpecification":"RSPEC-6146","sqKey":"S6146","scope":"All","defaultQualityProfiles":["Sonar way"],"quickfix":"unknown","allKeys":["S6146"],"branch":"master","languagesSupport":[{"name":"vb6","status":"ready"},{"name":"vbnet","status":"ready"}]} |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<div class="sect1"> | ||
<h2 id="_description">Description</h2> | ||
<div class="sectionbody"> | ||
|
||
</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>There are several compilations options available for Visual Basic source code and <code>Option Explicit</code> defines compiler behavior for implicit variable declarations. Not specifying <code>Option Explicit</code> will allow creating a variable by it’s first usage. This behavior can lead to unexpected runtime errors due to typos in variable names.</p> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="sect1"> | ||
<h2 id="_how_to_fix_it">How to fix it</h2> | ||
<div class="sectionbody"> | ||
<div class="paragraph"> | ||
<p><code>Option Explicit</code> should be added to every individual source file.</p> | ||
</div> | ||
<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-vb6" data-lang="vb6">Sub DoSomething(First As String, Second As String) | ||
Parameter = Fist ' New local variable "Fist" is created and assigned to new local variable "Parameter" instead of "First" argument. | ||
DoSomething(Parameter) | ||
Parametr = Second ' "Second" argument is assigned to newly created variable "Parametr" instead of intended "Parameter". | ||
DoSomething(Parameter) ' Value of "Parameter" is always Nothing | ||
End Sub</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-vb6" data-lang="vb6">Option Explicit | ||
|
||
Sub DoSomething(First As String, Second As String) | ||
Dim Parameter As String = First | ||
DoSomething(Parameter) | ||
Parameter = Second | ||
DoSomething(Parameter) | ||
End Sub</code></pre> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{"title":"\"Option Explicit\" should be enabled","type":"CODE_SMELL","code":{"impacts":{"MAINTAINABILITY":"HIGH"},"attribute":"COMPLETE"},"status":"ready","remediation":{"func":"Constant/Issue","constantCost":"3h"},"tags":["bad-practice"],"extra":{"replacementRules":[],"legacyKeys":[]},"defaultSeverity":"Critical","ruleSpecification":"RSPEC-6146","sqKey":"S6146","scope":"All","defaultQualityProfiles":["Sonar way"],"quickfix":"unknown","allKeys":["S6146"],"branch":"master","languagesSupport":[{"name":"vb6","status":"ready"},{"name":"vbnet","status":"ready"}]} |
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 +1 @@ | ||
{"title":"\"Option Explicit\" should be enabled","type":"CODE_SMELL","code":{"impacts":{"MAINTAINABILITY":"HIGH"},"attribute":"COMPLETE"},"status":"ready","remediation":{"func":"Constant/Issue","constantCost":"3h"},"tags":["bad-practice"],"extra":{"replacementRules":[],"legacyKeys":[]},"defaultSeverity":"Critical","ruleSpecification":"RSPEC-6146","sqKey":"S6146","scope":"All","defaultQualityProfiles":["Sonar way"],"quickfix":"unknown","allKeys":["S6146"],"branch":"master","languagesSupport":[{"name":"vbnet","status":"ready"}]} | ||
{"title":"\"Option Explicit\" should be enabled","type":"CODE_SMELL","code":{"impacts":{"MAINTAINABILITY":"HIGH"},"attribute":"COMPLETE"},"status":"ready","remediation":{"func":"Constant/Issue","constantCost":"3h"},"tags":["bad-practice"],"extra":{"replacementRules":[],"legacyKeys":[]},"defaultSeverity":"Critical","ruleSpecification":"RSPEC-6146","sqKey":"S6146","scope":"All","defaultQualityProfiles":["Sonar way"],"quickfix":"unknown","allKeys":["S6146"],"branch":"master","languagesSupport":[{"name":"vb6","status":"ready"},{"name":"vbnet","status":"ready"}]} |
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 +1 @@ | ||
{"langs":{"abap":123,"apex":70,"cfamily":923,"csharp":598,"default":3707,"flex":100,"go":56,"java":978,"javascript":575,"jcl":21,"kotlin":158,"php":329,"python":428,"rpg":94,"ruby":42,"scala":43,"swift":149,"plsql":216,"dart":115,"vbnet":266,"html":106,"pli":34,"tsql":86,"vb6":66,"xml":60,"cobol":225,"css":28,"ansible":17,"azureresourcemanager":32,"cloudformation":28,"docker":45,"kubernetes":24,"terraform":51,"secrets":123,"text":2},"tags":{"convention":233,"cert":361,"misra-c++2008":59,"pitfall":328,"based-on-misra":208,"cppcoreguidelines":86,"suspicious":189,"brain-overload":88,"misra":28,"bad-practice":140,"unused":84,"clumsy":181,"lock-in":49,"cwe":435,"error-handling":68,"psr2":8,"error-reporting":3,"user-experience":26,"sql":103,"obsolete":58,"android":26,"accessibility":48,"react":77,"wcag2-a":10,"injection":1,"html5":5,"cross-browser":4,"design":60,"bug":37,"confusing":147,"unpredictable":46,"es2015":22,"type-dependent":73,"redundant":25,"performance":195,"since-c++11":62,"multi-threading":55,"leak":15,"denial-of-service":18,"symbolic-execution":67,"data-science":20,"numpy":15,"pytorch":9,"microfocus":1,"logging":15,"jsp-jsf":6,"deprecated":12,"pep":6,"preprocessor":11,"java8":24,"tests":65,"junit":23,"phpunit":12,"security":5,"python3":18,"psr1":3,"per":2,"finding":12,"i18n":1,"serialization":18,"hibernate":9,"spring":47,"django":12,"express.js":17,"fastapi":2,"flask":6,"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,"syntax":4,"jquery":1,"assertj":7,"mockito":5,"msvc":1,"swing":1,"deadlock":3,"async-await":8,"php-ini":6,"typing":22,"maven":9,"since-c++14":5,"c11":1,"gnu":3,"xsd":18,"defign":1,"localisation":4,"duplicate":1,"mef":3,"winforms":1,"event":1,"regex":40,"wpf":1,"xaml":1,"proficiency":5,"aws":33,"azure":24,"gcp":20,"rules":1,"antipattern":1,"jsx":8,"yield":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":24,"unittest":2,"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":8,"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,"scientific-computing":4,"pandas":9,"graphql":2,"blazor":9,"paths":1,"best-practice":1,"java21":15,"datetime":7,"sustainability":10,"java":1,"jpa":1,"machine-learning":18,"tensorflow":7,"susceptibility":1,"asp.net":11,"scikit-learn":5,"since-c++23":6,"respectful":1,"assembler":1},"qualityProfiles":{"Sonar way":2525,"Drupal":1}} | ||
{"langs":{"abap":123,"apex":70,"cfamily":923,"csharp":598,"default":3707,"flex":100,"go":56,"java":978,"javascript":575,"jcl":21,"kotlin":158,"php":329,"python":428,"rpg":94,"ruby":42,"scala":43,"swift":149,"plsql":216,"dart":115,"vbnet":266,"html":106,"pli":34,"tsql":86,"vb6":67,"xml":60,"cobol":225,"css":28,"ansible":17,"azureresourcemanager":32,"cloudformation":28,"docker":45,"kubernetes":24,"terraform":51,"secrets":123,"text":2},"tags":{"convention":233,"cert":361,"misra-c++2008":59,"pitfall":328,"based-on-misra":208,"cppcoreguidelines":86,"suspicious":189,"brain-overload":88,"misra":28,"bad-practice":140,"unused":84,"clumsy":181,"lock-in":49,"cwe":435,"error-handling":68,"psr2":8,"error-reporting":3,"user-experience":26,"sql":103,"obsolete":58,"android":26,"accessibility":48,"react":77,"wcag2-a":10,"injection":1,"html5":5,"cross-browser":4,"design":60,"bug":37,"confusing":147,"unpredictable":46,"es2015":22,"type-dependent":73,"redundant":25,"performance":195,"since-c++11":62,"multi-threading":55,"leak":15,"denial-of-service":18,"symbolic-execution":67,"data-science":20,"numpy":15,"pytorch":9,"microfocus":1,"logging":15,"jsp-jsf":6,"deprecated":12,"pep":6,"preprocessor":11,"java8":24,"tests":65,"junit":23,"phpunit":12,"security":5,"python3":18,"psr1":3,"per":2,"finding":12,"i18n":1,"serialization":18,"hibernate":9,"spring":47,"django":12,"express.js":17,"fastapi":2,"flask":6,"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,"syntax":4,"jquery":1,"assertj":7,"mockito":5,"msvc":1,"swing":1,"deadlock":3,"async-await":8,"php-ini":6,"typing":22,"maven":9,"since-c++14":5,"c11":1,"gnu":3,"xsd":18,"defign":1,"localisation":4,"duplicate":1,"mef":3,"winforms":1,"event":1,"regex":40,"wpf":1,"xaml":1,"proficiency":5,"aws":33,"azure":24,"gcp":20,"rules":1,"antipattern":1,"jsx":8,"yield":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":24,"unittest":2,"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":8,"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,"scientific-computing":4,"pandas":9,"graphql":2,"blazor":9,"paths":1,"best-practice":1,"java21":15,"datetime":7,"sustainability":10,"java":1,"jpa":1,"machine-learning":18,"tensorflow":7,"susceptibility":1,"asp.net":11,"scikit-learn":5,"since-c++23":6,"respectful":1,"assembler":1},"qualityProfiles":{"Sonar way":2525,"Drupal":1}} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.