rspec/rules/S1117/why-general.adoc
Marco Borgeaud 98517de0ff
Modify rule S1117: Migrate To LayC - shadow variables (#3270)
The languages for this rule fall into two categories:

* CFamily, JS, and PLSQL: "Variables should not be shadowed" (general
case of shadowing)
* C#, Flex, Java, PHP, Swift: "Local variables should not shadow
field/property/enum case/..." (narrow case of shadowing)

For CFamily, these tickets are also handled: CPP-2785 CPP-3589
2023-10-16 12:04:08 +02:00

9 lines
324 B
Plaintext

== Why is this an issue?
Variable shadowing happens when a variable declared in a specific scope has the same name as a variable in an outer scope.
include::problems.adoc[]
To avoid these problems, rename the shadowing, shadowed, or both variables to accurately represent their purpose with unique and meaningful names.