コード例 #1
0
 public ProjectBuildArguments(string projectName, string projectFile, RepositorySourceType sourceType, string buildFolder)
 {
     ProjectName       = projectName;
     ProjectFile       = projectFile;
     SourceType        = sourceType;
     BuildOutputFolder = buildFolder;
 }
コード例 #2
0
 public IProjectBuilder BuilderFor(RepositorySourceType sourceType)
 {
     if (sourceType == RepositorySourceType.CSharp)
     {
         return(new DotNetProjectBuilder());
     }
     throw new NotSupportedException($"Currently there is not builder for {sourceType}");
 }
コード例 #3
0
        public ICodebaseAnalyzer For(RepositorySourceType sourceType)
        {
            if (sourceType == RepositorySourceType.CSharp)
            {
                return(new CSharpToxicityAnalyzer());
            }
            if (sourceType == RepositorySourceType.ECMA)
            {
                return(new JavascriptToxicityAnalyzer());
            }

            return(new JavaToxicityAnalyzer());
        }
コード例 #4
0
        private static string GetHightlight(RepositorySourceType sourceType)
        {
            switch (sourceType)
            {
            case RepositorySourceType.CSharp:
                return("csharp.xshd");

            case RepositorySourceType.Java:
                return("java.xshd");

            default:
                return("javascript.xshd");
            }
        }
コード例 #5
0
        private void RunTestFor(ParseType parseType, RepositorySourceType srcType, string languageToken, int languageThreshold)
        {
            var step = new CpdCollectionStep(parseType);

            Args.RepositorySourceType = srcType;
            var command = step.PrepareCommand(Args, Result);

            command.Should().NotBeEmpty();
            command.ShouldContainText("net.sourceforge.pmd.cpd.CPD")
            .ShouldContainText("--format csv")
            .ShouldContainText($"--language {languageToken}")
            .ShouldContainText($"--minimum-tokens {languageThreshold}")
            .ShouldContainText($"--files '{Args.SourceDirectory}'")
            .ShouldContainText($"> '{Result.MetricsFile}'");

            step.ValidateMetricResults("afile").Should().BeEmpty();
        }
コード例 #6
0
ファイル: Canvas.xaml.cs プロジェクト: gkarwchan/metropolis
        private void SetInstanceLabel(RepositorySourceType repositorySourceType)
        {
            switch (repositorySourceType)
            {
            case RepositorySourceType.CSharp:
                InstanceLabel.Content = "Types";
                break;

            case RepositorySourceType.Java:
                InstanceLabel.Content = "Types";
                break;

            case RepositorySourceType.ECMA:
                InstanceLabel.Content = "Files";
                break;

            default:
                InstanceLabel.Content = "Types";
                break;
            }
        }
コード例 #7
0
ファイル: CodeBase.cs プロジェクト: gkarwchan/metropolis
 public CodeBase(string name, CodeGraph graph, RepositorySourceType sourceType = RepositorySourceType.CSharp)
 {
     Name       = name;
     Graph      = graph;
     SourceType = sourceType;
 }
コード例 #8
0
 private static Stream GetHightlightResourceStream(RepositorySourceType syntaxHighlighting)
 {
     return(Assembly.GetExecutingAssembly().GetManifestResourceStream($"Metropolis.Resources.Highlighting.{GetHightlight(syntaxHighlighting)}"));
 }
コード例 #9
0
 public ICollectionStep GetStep(RepositorySourceType sourceType)
 {
     return(commandMap[sourceType]());
 }
コード例 #10
0
 private static void RunTest <T>(RepositorySourceType type) where T : IProjectBuilder
 {
     new ProjectBuildFactory().BuilderFor(type).Should().BeOfType <T>();
 }