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