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

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

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

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

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

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

            return(this.score.Value);
        }
コード例 #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();
        }
コード例 #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");
        }