Exemplo n.º 1
0
 private void CheckLevelOfNestedStructures(IEmbeddedStatement embedded, string methodName)
 {
     if (HasTooManyNestedLevels(embedded))
     {
         _analyzeErrors.Add(new AnalyzeError(QualityRules.NestedStructure, methodName, embedded.LineNumber));
     }
 }
Exemplo n.º 2
0
 private void CheckSizeOfCodeBlock(IEmbeddedStatement embedded, string methodName)
 {
     if (HasTooManyLinesInBlock(embedded))
     {
         _analyzeErrors.Add(new AnalyzeError(QualityRules.EmbeddedStatementsBlockSize, methodName,
                                             embedded.LineNumber));
     }
 }
Exemplo n.º 3
0
 private bool HasTooManyNestedLevels(IEmbeddedStatement structure)
 {
     return(structure.CountNestedStructures() > _maxNestedLevel);
 }
Exemplo n.º 4
0
        private bool HasTooManyLinesInBlock(IEmbeddedStatement structure)
        {
            var exceededMaximum = structure.GetLinesOfCodeCount() > _maxLinesInBlock;

            return(exceededMaximum);
        }