<commit_before>using System.Collections.Generic;
using System.Linq;
using Cake.Codecov;
using Cake.Common;
using Cake.Common.Build;
using Cake.Common.Diagnostics;
using Cake.Core.IO;
using Cake.Frosting;

[Dependency(typeof(Build))]
public sealed class CodeCoverage : FrostingTask<Context>
{
    public override void Run(Context context)
    {
        var coverageFiles = new List<FilePath>();

        if (context.AppVeyor)
        {
            foreach (var project in context.Projects.Where(x => x.UnitTests))
            {
                context.Information("Executing Code Coverage for Project {0}...", project.Name);

                var dotNetCoreCoverage = context.CodeCoverage
                    .CombineWithFilePath(project.Name + "-netcoreapp2.1.xml");
                coverageFiles.Add(dotNetCoreCoverage);

                context.Coverlet(project, new CoverletToolSettings()
                {
                    Configuration = context.Configuration,
                    Framework = "netcoreapp2.1",
                    Output = dotNetCoreCoverage.FullPath
                });

                if (context.IsRunningOnWindows())
                {
                    var dotNetFrameworkCoverage = context.CodeCoverage
                        .CombineWithFilePath(project.Name + "-net452.xml");
                    coverageFiles.Add(dotNetFrameworkCoverage);

                    context.Coverlet(project, new CoverletToolSettings
                    {
                        Configuration = context.Configuration,
                        Framework = "net452",
                        Output = dotNetFrameworkCoverage.FullPath
                    });
                }

                context.Information("Uploading Coverage Files: {0}", string.Join(",", coverageFiles.Select(path => path.GetFilename().ToString())));

                var buildVersion = $"{context.Version.FullSemVer}.build.{context.EnvironmentVariable("APPVEYOR_BUILD_NUMBER")}";

                var userProfilePath = context.EnvironmentVariable("USERPROFILE");
                var codecovPath = new DirectoryPath(userProfilePath)
                    .CombineWithFilePath(".nuget\\packages\\codecov\\1.7.2\\tools\\codecov.exe");

                context.Tools.RegisterFile(codecovPath);

                foreach (var coverageFile in coverageFiles)
                {
                    var settings = new CodecovSettings
                    {
                        Files = new[] { coverageFile.MakeAbsolute(context.Environment).FullPath },
                        Verbose = true,
                        EnvironmentVariables = new Dictionary<string, string>()
                        {
                            { "APPVEYOR_BUILD_VERSION", buildVersion}
                        }
                    };

                    context.Codecov(settings);
                }
            }
        }
    }
}<commit_msg>no longer testing with net452<commit_after>using System.Collections.Generic;
using System.Linq;
using Cake.Codecov;
using Cake.Common;
using Cake.Common.Build;
using Cake.Common.Diagnostics;
using Cake.Core.IO;
using Cake.Frosting;

[Dependency(typeof(Build))]
public sealed class CodeCoverage : FrostingTask<Context>
{
    public override void Run(Context context)
    {
        var coverageFiles = new List<FilePath>();

        if (context.AppVeyor)
        {
            foreach (var project in context.Projects.Where(x => x.UnitTests))
            {
                context.Information("Executing Code Coverage for Project {0}...", project.Name);

                var dotNetCoreCoverage = context.CodeCoverage
                    .CombineWithFilePath(project.Name + "-netcoreapp2.1.xml");
                coverageFiles.Add(dotNetCoreCoverage);

                context.Coverlet(project, new CoverletToolSettings()
                {
                    Configuration = context.Configuration,
                    Framework = "netcoreapp2.1",
                    Output = dotNetCoreCoverage.FullPath
                });

                if (context.IsRunningOnWindows())
                {
                    var dotNetFrameworkCoverage = context.CodeCoverage
                        .CombineWithFilePath(project.Name + "-net46.xml");
                    coverageFiles.Add(dotNetFrameworkCoverage);

                    context.Coverlet(project, new CoverletToolSettings
                    {
                        Configuration = context.Configuration,
                        Framework = "net452",
                        Output = dotNetFrameworkCoverage.FullPath
                    });
                }

                context.Information("Uploading Coverage Files: {0}", string.Join(",", coverageFiles.Select(path => path.GetFilename().ToString())));

                var buildVersion = $"{context.Version.FullSemVer}.build.{context.EnvironmentVariable("APPVEYOR_BUILD_NUMBER")}";

                var userProfilePath = context.EnvironmentVariable("USERPROFILE");
                var codecovPath = new DirectoryPath(userProfilePath)
                    .CombineWithFilePath(".nuget\\packages\\codecov\\1.7.2\\tools\\codecov.exe");

                context.Tools.RegisterFile(codecovPath);

                foreach (var coverageFile in coverageFiles)
                {
                    var settings = new CodecovSettings
                    {
                        Files = new[] { coverageFile.MakeAbsolute(context.Environment).FullPath },
                        Verbose = true,
                        EnvironmentVariables = new Dictionary<string, string>()
                        {
                            { "APPVEYOR_BUILD_VERSION", buildVersion}
                        }
                    };

                    context.Codecov(settings);
                }
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.09176834507647362, 'fraction_numerical': 0.005499226671249356, 'mean_word_length': 1.5855175477565526, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5419694', 'n_tokens_mistral': 1455, 'n_tokens_neox': 1312, 'n_words': 240}