Esempio n. 1
0
        private static void AnalyzeSolution(FileInfo inputFile, IDedoxConfig config, IDedoxMetrics metrics)
        {
            var dir = inputFile.Directory;

            if (dir != null)
            {
                var projects =
                    File.ReadAllLines(inputFile.FullName)
                    .Where(s => s.StartsWith("Project("))
                    .Select(s => s.Split('=')[1].Trim().Split(',')[1].Trim())
                    .Select(s => s.Substring(1, s.Length - 2))
                    .Where(s => s.EndsWith(".csproj"))
                    .ToList();

                foreach (var p in projects)
                {
                    config.Writer.Info();
                    var projectPath     = Path.Combine(dir.FullName, p);
                    var projectFileInfo = new FileInfo(projectPath);
                    if (projectFileInfo.Exists)
                    {
                        AnalyzeProject(projectFileInfo, config, metrics);
                    }
                }
            }
        }
        protected GeneratedCommentsChecker(T it, IDedoxConfig config, IDedoxMetrics metrics)
        {
            It = it;

            _config  = config;
            _writer  = config.Writer;
            _metrics = metrics;
        }
Esempio n. 3
0
        private static void AnalyzeCodeFile(FileInfo inputFile, IDedoxConfig config, IDedoxMetrics metrics)
        {
            config.Writer.Info("> Processing code file {0}.", inputFile.Name);

            var source = File.ReadAllText(inputFile.FullName);
            var output = new Dedoxifier(config, metrics).Run(source);

            if (output != null)
            {
                var outDir  = config.OutputDirectory ?? inputFile.DirectoryName ?? @"C:\temp";
                var outFile = Path.Combine(outDir, inputFile.Name);
                File.WriteAllText(outFile, output);
            }

            config.Writer.Info();
            config.Writer.Info();
        }
Esempio n. 4
0
 public GeneratedPropertyCommentsChecker(PropertyDeclarationSyntax it, IDedoxConfig config, IDedoxMetrics metrics)
     : base(it, config, metrics)
 {
 }
 public GeneratedFieldCommentsChecker(FieldDeclarationSyntax it, IDedoxConfig config, IDedoxMetrics metrics)
     : base(it, config, metrics)
 {
 }
 public GeneratedIndexerCommentsChecker(IndexerDeclarationSyntax declaration, IDedoxConfig config, IDedoxMetrics metrics) : base(declaration, config, metrics)
 {
 }
Esempio n. 7
0
 public GeneratedEnumMemberCommentsChecker(EnumMemberDeclarationSyntax it, IDedoxConfig config, IDedoxMetrics metrics)
     : base(it, config, metrics)
 {
 }
 public GeneratedInterfaceCommentsChecker(InterfaceDeclarationSyntax it, IDedoxConfig config, IDedoxMetrics metrics)
     : base(it, config, metrics)
 {
 }
 protected GeneratedSummaryCommentsChecker(T it, IDedoxConfig config, IDedoxMetrics metrics)
     : base(it, config, metrics)
 {
 }
Esempio n. 10
0
 public Dedoxifier(IDedoxConfig config, IDedoxMetrics metrics)
 {
     _config  = config;
     _writer  = config.Writer;
     _metrics = metrics;
 }
Esempio n. 11
0
 public GeneratedClassCommentsChecker(ClassDeclarationSyntax classDeclaration, IDedoxConfig config, IDedoxMetrics metrics)
     : base(classDeclaration, config, metrics)
 {
 }
Esempio n. 12
0
        private static void AnalyzeProject(FileInfo projectFile, IDedoxConfig config, IDedoxMetrics metrics)
        {
            var dir = projectFile.Directory;

            if (dir == null)
            {
                return;
            }

            var fileInfos = GetCodeFilesFromProjectFile(projectFile)
                            .Select(file => Path.Combine(dir.FullName, file))
                            .Select(filePath => new FileInfo(filePath))
                            .ToList();

            foreach (var file in fileInfos)
            {
                AnalyzeCodeFile(file, config, metrics);
            }
        }
Esempio n. 13
0
        private static void ProcessInputFile(FileInfo inputFile, IDedoxConfig config, IDedoxMetrics metrics)
        {
            var writer = config.Writer;

            if (inputFile.Exists)
            {
                writer.Info("Processing file: " + inputFile.Name);

                if (inputFile.Name.EndsWith(".sln"))
                {
                    AnalyzeSolution(inputFile, config, metrics);
                }
                else if (inputFile.Name.EndsWith(".csproj"))
                {
                    AnalyzeProject(inputFile, config, metrics);
                }
                else if (inputFile.Name.EndsWith(".cs"))
                {
                    AnalyzeCodeFile(inputFile, config, metrics);
                }
            }
            else
            {
                writer.Info("No such file: " + inputFile.FullName);
            }
        }
 public GeneratedConstructorCommentsChecker(ConstructorDeclarationSyntax it, IDedoxConfig config, IDedoxMetrics metrics)
     : base(it, config, metrics)
 {
 }