Menu

#639 Static code analyzer glitch with 'var', etc.

v1.1.x
fixed
v1.1.3
Bug Fix
2022-01-17
2021-08-31
Erik Hänel
No

If the static code analyzer analyzes a local variable stack like var a,b,c; it will mark c; as never used, because it erroneously adds the ; to the variable's name.

Analysis:

This issue can be solved by adding ; to the find_first_of() methods in lines 784-785 in codeanalyzer.cpp

Implementation:

  • Implementation: Implemented as proposed by the analysis.
  • Revision: [r998]
  • Implementation test: The static code analyzer was started and a semicolon was added to a variable list. No variable was erroneously marked as unused

Documentation:

  • ChangesLog updated
  • Code changes commented
  • Documentation articles:
    • corresponding documentation articles updated
    • new documentation articles created
    • not needed
  • Language files:
    • corresponding language files updated
    • not needed

Tests:

Fix was tested manually. No deviations detected.

Related

Commit: [r998]

Discussion

  • Erik Hänel

    Erik Hänel - 2021-08-31
    • labels: --> editor, gui
    • status: open --> accepted
     
  • Erik Hänel

    Erik Hänel - 2021-08-31
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1,23 @@
     If the static code analyzer analyzes a local variable stack like `var a,b,c;` it will mark `c;` as never used, because it erroneously adds the `;` to the variable's name.
    +
    +###Analysis:
    +(*Describe, what's the issue and which changes have to be made*)
    +
    +###Implementation:
    +* Implementation: (*Describe, what you've changed*) 
    +* Revision: [rXXX]
    +* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +
    +###Documentation:
    +* [ ] ChangesLog updated
    +* [ ] Code changes commented
    +* **Documentation articles:**
    +    * [ ] corresponding documentation articles updated
    +    * [ ] new documentation articles created
    +    * [ ] not needed
    +* **Language files:**
    +    * [ ] corresponding language files updated
    +    * [ ] not needed
    +
    +###Tests:
    +(*Describe, which tests you performed and their outcome*)
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2021-08-31
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,7 +1,7 @@
     If the static code analyzer analyzes a local variable stack like `var a,b,c;` it will mark `c;` as never used, because it erroneously adds the `;` to the variable's name.
    
     ###Analysis:
    -(*Describe, what's the issue and which changes have to be made*)
    +This issue can be solved by adding `;` to the `find_first_of()` methods in lines 784-785 in codeanalyzer.cpp
    
     ###Implementation:
     * Implementation: (*Describe, what you've changed*) 
    
    • status: analyzing --> implementing
     
  • Erik Hänel

    Erik Hänel - 2021-08-31
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -4,20 +4,20 @@
     This issue can be solved by adding `;` to the `find_first_of()` methods in lines 784-785 in codeanalyzer.cpp
    
     ###Implementation:
    -* Implementation: (*Describe, what you've changed*) 
    -* Revision: [rXXX]
    -* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +* Implementation: Implemented as proposed by the analysis.
    +* Revision: [r998]
    +* Implementation test: The static code analyzer was started and a semicolon was added to a variable list. No variable was erroneously marked as unused
    
     ###Documentation:
    -* [ ] ChangesLog updated
    +* [x] ChangesLog updated
     * [ ] Code changes commented
     * **Documentation articles:**
         * [ ] corresponding documentation articles updated
         * [ ] new documentation articles created
    -    * [ ] not needed
    +    * [x] not needed
     * **Language files:**
         * [ ] corresponding language files updated
    -    * [ ] not needed
    +    * [x] not needed
    
     ###Tests:
     (*Describe, which tests you performed and their outcome*)
    
    • status: implementing --> testing
     

    Related

    Commit: [r998]

  • Erik Hänel

    Erik Hänel - 2022-01-17
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -20,4 +20,4 @@
         * [x] not needed
    
     ###Tests:
    -(*Describe, which tests you performed and their outcome*)
    +Fix was tested manually. No deviations detected.
    
    • status: testing --> fixed
     

Anonymous
Anonymous

Add attachments
Cancel