< Summary

Class:PrimitiveMeshModel
Assembly:DCLResourcesModel
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Models/DCLResources/PrimitiveMeshModel.cs
Covered lines:15
Uncovered lines:4
Coverable lines:19
Total lines:56
Line coverage:78.9% (15 of 19)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
operator==(...)0%2100%
operator!=(...)0%2100%
PrimitiveMeshModel(...)0%110100%
Equals(...)0%440100%
Equals(...)0%4.374071.43%
GetHashCode()0%330100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Models/DCLResources/PrimitiveMeshModel.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using Google.Protobuf.Collections;
 4using UnityEngine;
 5
 6public class PrimitiveMeshModel
 7{
 08    public static bool operator ==(PrimitiveMeshModel left, PrimitiveMeshModel right) { return Equals(left, right); }
 09    public static bool operator !=(PrimitiveMeshModel left, PrimitiveMeshModel right) { return !Equals(left, right); }
 10
 11    public enum Type
 12    {
 13        Box,
 14        Sphere,
 15        Plane,
 16        Cylinder
 17    }
 18
 4319    public PrimitiveMeshModel(Type type)
 20    {
 4321        this.type = type;
 4322    }
 23
 24    public Type type;
 25    public float radiusTop;
 26    public float radiusBottom;
 4327    public RepeatedField<float> uvs = new RepeatedField<float>();
 28
 29    protected bool Equals(PrimitiveMeshModel other)
 30    {
 7031        return type == other.type && radiusTop.Equals(other.radiusTop) && radiusBottom.Equals(other.radiusBottom) && Equ
 32    }
 33
 34    public override bool Equals(object obj)
 35    {
 37336        if (ReferenceEquals(null, obj))
 037            return false;
 37338        if (ReferenceEquals(this, obj))
 30339            return true;
 7040        if (obj.GetType() != this.GetType())
 041            return false;
 7042        return Equals((PrimitiveMeshModel) obj);
 43    }
 44
 45    public override int GetHashCode()
 46    {
 47        unchecked
 48        {
 70549            int hashCode = (int) type;
 70550            hashCode = (hashCode * 397) ^ radiusTop.GetHashCode();
 70551            hashCode = (hashCode * 397) ^ radiusBottom.GetHashCode();
 70552            hashCode = (hashCode * 397) ^ (uvs != null ? uvs.GetHashCode() : 0);
 70553            return hashCode;
 54        }
 55    }
 56}