Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When a larger scope than necessary is used, code becomes less readable, harder to maintain, and more likely to reference unintended variables . (See see DCL01-C. Do not reuse variable names in subscopes).)

Noncompliant Code Example

...

Tool

Version

Checker

Description

CodeSonar
Include Page
CodeSonar_V
CodeSonar_V

LANG.STRUCT.SCOPE.FILE
LANG.STRUCT.SCOPE.LOCAL

Scope could be file static
Scope could be local static

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

CC2.DCL19

Fully implemented

LDRA tool suite 
Include Page
LDRA_V
LDRA_V
25 D, 61 D, 40 SFully Implementedimplemented
PRQA QA-C
Include Page
PRQA QA-C_v
PRQA QA-C_v
1504, 1505, 1531, 1532, 3210, 3218 

...