Exemple #1
0
        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);
        }
Exemple #2
0
        public List <string> GetJustificationList(WarningScoresManager scoreManager)
        {
            Contract.Requires(scoreManager != null);

            if (this.justification == null)
            {
                EnsureScoreAndJustificationAreComputed(scoreManager);
            }

            return(this.justification_expanded);
        }
Exemple #3
0
        public string GetJustificationString(WarningScoresManager scoreManager)
        {
            Contract.Requires(scoreManager != null);

            if (this.justification == null)
            {
                EnsureScoreAndJustificationAreComputed(scoreManager);
            }

            return(this.justification);
        }
Exemple #4
0
        public double GetScore(WarningScoresManager scoresManager)
        {
            Contract.Requires(scoresManager != null);

            if (!this.score.HasValue)
            {
                EnsureScoreAndJustificationAreComputed(scoresManager);
            }

            return(this.score.Value);
        }
Exemple #5
0
        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();
        }
Exemple #6
0
        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");
        }