< Summary

Information
Class: Syki.Back.Configs.ServicesConfigs
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Configs/ServicesConfigs.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 14
Uncovered lines: 0
Coverable lines: 14
Total lines: 27
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
AddServicesConfigs(...)100%11100%
AddServiceConfigs(...)100%44100%

File(s)

/home/runner/work/syki/syki/Back/Configs/ServicesConfigs.cs

#LineLine coverage
 1namespace Syki.Back.Configs;
 2
 3public static class ServicesConfigs
 4{
 5    public static void AddServicesConfigs(this IServiceCollection services)
 6    {
 17        services.AddServiceConfigs(typeof(IAcademicService));
 18        services.AddServiceConfigs(typeof(IAdmService));
 19        services.AddServiceConfigs(typeof(ICrossService));
 110        services.AddServiceConfigs(typeof(IStudentService));
 111        services.AddServiceConfigs(typeof(ITeacherService));
 112    }
 13
 14    private static void AddServiceConfigs(this IServiceCollection services, Type marker)
 15    {
 516        var types = AppDomain.CurrentDomain.GetAssemblies()
 74517            .Where(s => s.FullName.StartsWith("Back"))
 518            .SelectMany(s => s.GetTypes())
 331019            .Where(p => marker.IsAssignableFrom(p) && !p.IsInterface)
 520            .ToList();
 21
 14622        foreach (var type in types)
 23        {
 6824            services.AddScoped(type);
 25        }
 526    }
 27}