예제 #1
0
        private void CallMainAndCheckResult(string tempInputFilePath, string outputPath,
                                            AnalyzerLanguage language)
        {
            var retValue = Program.Main(new[]
            {
                tempInputFilePath,
                outputPath,
                language.ToString()
            });

            if (retValue != 0)
            {
                Assert.Fail("Analysis failed with error");
            }

            RemoveExactFilePathNames(outputPath);

            var output = ParseAnalysisXmlOutput(outputPath);
            var omstar = GenerateOmstarOutput(output);

            AddMissingEntries(omstar, language);
            SplitAndStoreOmstarByIssueType(omstar, language);
            List <string> problematicRules;

            if (!FilesAreEquivalent(language, out problematicRules))
            {
                Assert.Fail("Expected and actual files are different, there are differences for rules: {0}",
                            string.Join(", ", problematicRules));
            }
        }
예제 #2
0
 public static RuleDescription Convert(RuleDetail detail, string productVersion, AnalyzerLanguage language)
 {
     return(new RuleDescription
     {
         Key = detail.Key,
         Data = new Dictionary <string, RuleMetaData>
         {
             {
                 language.ToString(),
                 new RuleMetaData
                 {
                     Title = detail.Title,
                     Description =
                         GetParameterDescription(detail.Parameters) +
                         AddLinksBetweenRulesToDescription(detail.Description, productVersion) +
                         GetCodeFixDescription(detail),
                     Tags = detail.Tags,
                     Severity = detail.Severity,
                     IdeSeverity = detail.IdeSeverity
                 }
             }
         }
     });
 }
예제 #3
0
 public QualityProfileRoot(AnalyzerLanguage language)
 {
     Rules    = new List <QualityProfileRuleDescriptor>();
     Language = language.ToString();
     Name     = "Sonar way";
 }