Ejemplo n.º 1
0
        string FormatVerify(List <string> allMethods, GraphTrackingResults report)
        {
            return($@"All classes and methods:
{FormatLines(allMethods)}

Uncalled Classes:
{FormatLines(report.UnusedClasses.Select(uc => uc.FullName))}

Uncalled Methods:
{FormatLines(report.UnusedMethods.SelectMany(c => c.Value).Select(um => FormatMethod(um)))}
");
        }
Ejemplo n.º 2
0
        static void FormatOutputForFile(GraphTrackingResults report, List <string> unusedClassesFiltered)
        {
            File.WriteAllText(@"report.txt", $@"The following classes are unused:
{
                string.Join(Environment.NewLine, unusedClassesFiltered)
            }

Count: {unusedClassesFiltered.Count}

The following methods are unused:
{
                string.Join(Environment.NewLine,
                    report.UnusedMethods
                    .SelectMany(mi => mi.Value)
                    .Select(mi => mi.ToString()))
            }");
        }