Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COM.DATA.Invariant #114

Closed
6 tasks done
WaldoFR opened this issue Jun 14, 2018 · 1 comment · Fixed by #156
Closed
6 tasks done

COM.DATA.Invariant #114

WaldoFR opened this issue Jun 14, 2018 · 1 comment · Fixed by #156

Comments

@WaldoFR
Copy link

WaldoFR commented Jun 14, 2018

Implementation of the rule COM.DATA.Invariant

Description

It is mandatory to define as constants any invariant object.

Known problems

False positives when using awk

Code : awk 'BEGIN { FS = " "; StartType = 0; StartEnum = 0; typeName=""; }
Result: a violation of the rule is raisen on typename.

  • Fix status

False positive when using ++ in a loop

Code : (( PREPAR_UNE_SEUL_FOIS++ ))

  • Fix status

Function declaration

Description : The checker is not handling some types of functions declaration. The problem is the same one as defined for several rules in #49 .

  • Fix status

State of the implementation

  • Violation raising
  • Localization
  • Unit tests
@brigittehuynh
Copy link
Collaborator

I chose to correct the false positive in the for (( ... )) construct by ignoring the code between for (( and done.
Other choices could have been made, such as ignoring the for (( ...)) code, or treating the for as a mini function, with its own variables. This last solution would have been better but far more time consuming.

@WaldoFR WaldoFR closed this as completed Jul 6, 2018
@WaldoFR WaldoFR mentioned this issue Sep 13, 2018
begarco pushed a commit to begarco/i-CodeCNES that referenced this issue Jan 25, 2020
…nto account

with a specific FunctionInvariant class. The test files are updated
accordingly.
begarco pushed a commit to begarco/i-CodeCNES that referenced this issue Jan 25, 2020
begarco pushed a commit to begarco/i-CodeCNES that referenced this issue Jan 25, 2020
begarco pushed a commit that referenced this issue Feb 2, 2020
with a specific FunctionInvariant class. The test files are updated
accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants