Beispiel #1
0
        private string GetGroupName(IApiCopResult result)
        {
            switch (Grouping)
            {
            case ApiCopListenerGrouping.Cop:
                return(result.Cop.TargetType.FullName);

            case ApiCopListenerGrouping.Rule:
                return(result.Rule.Name);

            case ApiCopListenerGrouping.Tag:
                return(result.Tag);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Writes the result to the listener target.
        /// </summary>
        /// <param name="result">The result.</param>
        protected override void WriteResult(IApiCopResult result)
        {
            WriteLine("Cop:  {0}", result.Cop.TargetType);
            WriteLine("Rule: {0} ({1})", result.Rule.Name, result.Rule.Level);
            WriteLine(string.Empty);
            WriteLine(result.Rule.Description);
            WriteLine(string.Empty);

            if (!string.IsNullOrWhiteSpace(result.Rule.Url))
            {
                WriteLine("For more information about this rule, visit {0}", result.Rule.Url);
            }

            WriteLine(string.Empty);

            WriteLine("{0}", result.Rule.GetResultAsText(result.Tag));
            WriteLine(string.Empty);
            WriteLine("----------------------------------------------------------------");
            WriteLine(string.Empty);
        }
        /// <summary>
        /// Writes the result to the listener target.
        /// </summary>
        /// <param name="result">The result.</param>
        protected override void WriteResult(IApiCopResult result)
        {
            WriteLine("Cop:  {0}", result.Cop.TargetType);
            WriteLine("Rule: {0} ({1})", result.Rule.Name, result.Rule.Level);
            WriteLine(string.Empty);
            WriteLine(result.Rule.Description);
            WriteLine(string.Empty);

            if (!string.IsNullOrWhiteSpace(result.Rule.Url))
            {
                WriteLine("For more information about this rule, visit {0}", result.Rule.Url);
            }

            WriteLine(string.Empty);

            WriteLine("{0}", result.Rule.GetResultAsText(result.Tag));
            WriteLine(string.Empty);
            WriteLine("----------------------------------------------------------------");
            WriteLine(string.Empty);
        }
 /// <summary>
 /// Writes the result to the listener target.
 /// </summary>
 /// <param name="result">The result.</param>
 protected abstract void WriteResult(IApiCopResult result);
        private string GetGroupName(IApiCopResult result)
        {
            switch (Grouping)
            {
                case ApiCopListenerGrouping.Cop:
                    return result.Cop.TargetType.FullName;

                case ApiCopListenerGrouping.Rule:
                    return result.Rule.Name;

                case ApiCopListenerGrouping.Tag:
                    return result.Tag;

                default:
                    throw new ArgumentOutOfRangeException();
            }
        }
Beispiel #6
0
 /// <summary>
 /// Writes the result to the listener target.
 /// </summary>
 /// <param name="result">The result.</param>
 protected abstract void WriteResult(IApiCopResult result);