private void EnsureScoreAndJustificationAreComputed(WarningScoresManager scoresManager) { Contract.Ensures(this.score.HasValue); Contract.Ensures(this.justification != null); var pair = scoresManager.GetScore(this); this.score = pair.Item1; this.justification_expanded = pair.Item2; this.justification = String.Join(" ", this.justification_expanded); }
public List <string> GetJustificationList(WarningScoresManager scoreManager) { Contract.Requires(scoreManager != null); if (this.justification == null) { EnsureScoreAndJustificationAreComputed(scoreManager); } return(this.justification_expanded); }
public string GetJustificationString(WarningScoresManager scoreManager) { Contract.Requires(scoreManager != null); if (this.justification == null) { EnsureScoreAndJustificationAreComputed(scoreManager); } return(this.justification); }
public double GetScore(WarningScoresManager scoresManager) { Contract.Requires(scoresManager != null); if (!this.score.HasValue) { EnsureScoreAndJustificationAreComputed(scoresManager); } return(this.score.Value); }
public QuantitativeOutput( bool SortWarnings, bool ShowScores, bool showJustification, Func <WarningLevelOptions> WarningLevel, WarningScoresManager scoresManager, int MaxWarnings, IOutputFullResults <Method, Assembly> output) : base(output) { Contract.Requires(scoresManager != null); Contract.Requires(output != null); this.sortWarnings = SortWarnings; this.showJustification = showJustification; this.showScores = ShowScores; this.warningLevel = WarningLevel; this.maxWarnings = MaxWarnings; this.scoresManager = scoresManager; this.warnings = new SortedDictionary <double, List <Bucket> >(new InverseNaturalOrder()); this.emitCount = 0; this.outcomeCount = 0; this.swallowedCount = new SwallowedBuckets(); }
public string GetWarningLevel(double score, WarningScoresManager scoresManager) { Contract.Requires(scoresManager != null); if (score > scoresManager.LOWSCORE) { return("High"); } if (score > scoresManager.MEDIUMLOWSCORE) { return("MediumHigh"); } if (score > scoresManager.MEDIUMSCORE) { return("Medium"); } return("Low"); }