當前位置: 首頁>>代碼示例>>C#>>正文


C# AnalysisConfig.GetAnalysisSettings方法代碼示例

本文整理匯總了C#中SonarQube.Common.AnalysisConfig.GetAnalysisSettings方法的典型用法代碼示例。如果您正苦於以下問題:C# AnalysisConfig.GetAnalysisSettings方法的具體用法?C# AnalysisConfig.GetAnalysisSettings怎麽用?C# AnalysisConfig.GetAnalysisSettings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SonarQube.Common.AnalysisConfig的用法示例。


在下文中一共展示了AnalysisConfig.GetAnalysisSettings方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Execute

        public bool Execute(string[] args, AnalysisConfig config, TeamBuildSettings settings, ILogger logger)
        {
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            IAnalysisPropertyProvider provider;
            if (!ArgumentProcessor.TryProcessArgs(args, logger, out provider))
            {
                return false;
            }

            logger.Verbosity = VerbosityCalculator.ComputeVerbosity(config.GetAnalysisSettings(true), logger);
            LogStartupSettings(config, settings, logger);

            if (!CheckEnvironmentConsistency(config, settings, logger))
            {
                return false;
            }

            // if initialisation fails a warning will have been logged at the source of the failure
            bool initialised = this.codeCoverageProcessor.Initialise(config, settings, logger);

            if (initialised && !this.codeCoverageProcessor.ProcessCoverageReports())
            {
                //  if processing fails, stop the workflow
                return false;
            }

            ProjectInfoAnalysisResult result = InvokeSonarRunner(provider, config, logger);
            this.reportBuilder.GenerateReports(settings, config, result, logger);
            return result.RanToCompletion;
        }
開發者ID:BrightLight,項目名稱:sonar-msbuild-runner,代碼行數:46,代碼來源:MSBuildPostProcessor.cs

示例2: TryGetRegularExpression

        private string TryGetRegularExpression(AnalysisConfig config)
        {
            Debug.Assert(config != null, "Not expecting the supplied config to be null");

            string regEx;
            config.GetAnalysisSettings(true).TryGetValue(TestRegExSettingId, out regEx);

            if (!string.IsNullOrWhiteSpace(regEx))
            {
                this.Log.LogMessage(MessageImportance.Low, Resources.IsTest_UsingRegExFromConfig, regEx);
            }

            return regEx;
        }
開發者ID:clintcparker,項目名稱:sonar-msbuild-runner,代碼行數:14,代碼來源:IsTestFileByName.cs

示例3: GetAnalysisPropertiesToWrite

        /// <summary>
        /// Returns all of the analysis properties that should
        /// be written to the sonar-project properties file
        /// </summary>
        private static AnalysisProperties GetAnalysisPropertiesToWrite(AnalysisConfig config, ILogger logger)
        {
            AnalysisProperties properties = new AnalysisProperties();

            properties.AddRange(config.GetAnalysisSettings(false).GetAllProperties()
                // Strip out any sensitive properties
                .Where(p => !p.ContainsSensitiveData()));

            // There are some properties we want to override regardless of what the user sets
            AddOrSetProperty(VSBootstrapperPropertyKey, "false", properties, logger);

            return properties;
        }
開發者ID:BrightLight,項目名稱:sonar-msbuild-runner,代碼行數:17,代碼來源:PropertiesFileGenerator.cs

示例4: GetSensitiveFileSettings

        private static IEnumerable<string> GetSensitiveFileSettings(AnalysisConfig config, IEnumerable<string> userCmdLineArguments)
        {
            IEnumerable<Property> allPropertiesFromConfig = config.GetAnalysisSettings(false).GetAllProperties();

            return allPropertiesFromConfig.Where(p => p.ContainsSensitiveData() && !UserSettingExists(p, userCmdLineArguments))
                .Select(p => p.AsSonarRunnerArg());
        }
開發者ID:HSAR,項目名稱:sonar-msbuild-runner,代碼行數:7,代碼來源:SonarRunner.Wrapper.cs

示例5: AssertSettingDoesNotExist

 private static void AssertSettingDoesNotExist(string key, AnalysisConfig actualConfig)
 {
     Property setting;
     bool found = actualConfig.GetAnalysisSettings(true).TryGetProperty(key, out setting);
     Assert.IsFalse(found, "The setting should not exist. Key: {0}", key);
 }
開發者ID:BlackSwanBay,項目名稱:sonar-msbuild-runner,代碼行數:6,代碼來源:AnalysisConfigGeneratorTests.cs

示例6: FindBranch

        private static string FindBranch(AnalysisConfig config)
        {
            string branch = null;

            IAnalysisPropertyProvider localSettings = config.GetAnalysisSettings(includeServerSettings: false);
            Debug.Assert(localSettings != null);

            localSettings.TryGetValue(SonarProperties.ProjectBranch, out branch);

            return branch;
        }
開發者ID:Rinorragi,項目名稱:sonar-msbuild-runner,代碼行數:11,代碼來源:SummaryReportBuilder.cs

示例7: VerifySummaryReportData

        private static void VerifySummaryReportData(
            SummaryReportBuilder.SummaryReportData summaryReportData,
            ProjectInfoAnalysisResult analysisResult,
            string expectedHostUrl,
            AnalysisConfig config)
        {
            string expectedUrl;
            string branch;

            config.GetAnalysisSettings(false).TryGetValue("sonar.branch", out branch);

            if (String.IsNullOrEmpty(branch))
            {
                expectedUrl = String.Format(
                    SummaryReportBuilder.DashboardUrlFormat, 
                    expectedHostUrl, 
                    config.SonarProjectKey);
            }
            else
            {
                expectedUrl = String.Format(
                    SummaryReportBuilder.DashboardUrlFormatWithBranch, 
                    expectedHostUrl, 
                    config.SonarProjectKey, 
                    branch);
            }

            Assert.AreEqual(expectedUrl, summaryReportData.DashboardUrl, "Invalid dashboard url");
            Assert.AreEqual(analysisResult.RanToCompletion, summaryReportData.Succeeded, "Invalid outcome");

        }
開發者ID:BrightLight,項目名稱:sonar-msbuild-runner,代碼行數:31,代碼來源:SummaryReportBuilderTests.cs


注:本文中的SonarQube.Common.AnalysisConfig.GetAnalysisSettings方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。