< Summary

Class:KernelConfigModel
Assembly:KernelConfiguration
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/KernelConfiguration/KernelConfigModel.cs
Covered lines:27
Uncovered lines:3
Coverable lines:30
Total lines:62
Line coverage:90% (27 of 30)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
KernelConfigModel()0%110100%
Equals(...)0%6200%
Equals(...)0%14.3513080%
Clone()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/KernelConfiguration/KernelConfigModel.cs

#LineLine coverage
 1using KernelConfigurationTypes;
 2using System;
 3using System.Collections.Generic;
 4
 5[Serializable]
 6public class KernelConfigModel
 7{
 98    public Features features = new Features();
 99    public Comms comms = new Comms();
 910    public Profiles profiles = new Profiles();
 11    public bool gifSupported = false;
 912    public string network = "mainnet";
 913    public List<WorldRange> validWorldRanges = new List<WorldRange>();
 914    public string kernelVersion = string.Empty;
 915    public string rendererVersion = string.Empty;
 916    public Debugging debugConfig = new Debugging();
 917    public ProceduralSkybox proceduralSkyboxConfig = new ProceduralSkybox();
 18
 019    public override bool Equals(object obj) { return obj is KernelConfigModel other && Equals(other); }
 20
 21    public bool Equals(KernelConfigModel other)
 22    {
 723        if (other == null)
 024            return false;
 25
 726        if (validWorldRanges.Count != other.validWorldRanges.Count)
 227            return false;
 28
 1229        for (var i = 0; i < validWorldRanges.Count; i++)
 30        {
 131            if (!validWorldRanges[i].Equals(other.validWorldRanges[i]))
 032                return false;
 33        }
 34
 535        return comms.Equals(other.comms)
 36               && profiles.Equals(other.profiles)
 37               && features.Equals(other.features)
 38               && gifSupported == other.gifSupported
 39               && network == other.network
 40               && kernelVersion == other.kernelVersion
 41               && rendererVersion == other.rendererVersion
 42               && debugConfig.Equals(other.debugConfig)
 43               && proceduralSkyboxConfig.Equals(other.proceduralSkyboxConfig);
 44    }
 45
 46    public KernelConfigModel Clone()
 47    {
 48        // NOTE: We need to use deep clone
 249        KernelConfigModel clone = new KernelConfigModel();
 250        clone.comms = comms.Clone();
 251        clone.profiles = profiles.Clone();
 252        clone.features = features.Clone();
 253        clone.gifSupported = gifSupported;
 254        clone.network = network;
 255        clone.validWorldRanges = new List<WorldRange>(validWorldRanges);
 256        clone.kernelVersion = kernelVersion;
 257        clone.rendererVersion = rendererVersion;
 258        clone.debugConfig = debugConfig.Clone();
 259        clone.proceduralSkyboxConfig = proceduralSkyboxConfig.Clone();
 260        return clone;
 61    }
 62}