Query module NestedLoopsSameVariable

name
Nested loops with same variable
description
The behavior of nested loops that both have the same iteration variable can be difficult to understand, as the inner loop will affect the iteration of the outer loop. Most of the time this is an unintentional typo and a bug; in other cases it is merely very bad practice.
kind
problem
problem.severity
warning
precision
high
id
cs/nested-loops-with-same-variable
tags
maintainability correctness logic

Imports

ComparisonTest

Provides classes for capturing various ways of performing comparison tests.

csharp

The default C# QL library.

Classes

NestedForConditions

A structural comparison configuration for comparing the conditions of nested for loops.

NestedForLoopSameVariable

A nested for statement that shares the same iteration variable as an outer for statement.

Aliases

SC

Provides functionality for performing structural comparison of expressions and statements.