< Summary

Class:Residential
Assembly:Test
File(s):D:/--UnityProject/VR/subjects1_for_analysis/UnityCityView-master/UnityCityView-master/Assets/Scripts/Residential.cs
Covered lines:44
Uncovered lines:2
Coverable lines:46
Total lines:69
Line coverage:95.6% (44 of 46)
Covered branches:0
Total branches:0
Covered methods:10
Total methods:10
Method coverage:100% (10 of 10)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Start()0%000100%
Update()0%000100%
showlabel()0%000100%
GetLabel()0%00090.32%
GetBuilding1Name()0%000100%
GetBuilding2Name()0%000100%
GetBuilding3Name()0%000100%
GetBuilding4Name()0%000100%
GetBuilding41Name()0%000100%
GetBuilding42Name()0%000100%

File(s)

D:/--UnityProject/VR/subjects1_for_analysis/UnityCityView-master/UnityCityView-master/Assets/Scripts/Residential.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4using TMPro;
 5
 6public class Residential : MonoBehaviour
 7{
 8    // Start is called before the first frame update
 9  GameObject label;
 10    void Start()
 611    {
 612        GameObject player = GameObject.Find("Player");
 613    label = player.transform.GetChild(1).gameObject;
 614    }
 15
 16    // Update is called once per frame
 17    void Update()
 1494018    {
 19
 1494020    }
 21
 622  public void showlabel(){
 623    label.GetComponent<TextMeshPro>().text = GetLabel().Substring(0, 20);
 624  }
 25
 626  string GetLabel(){
 627    string ret = "Residential:";
 728    if(gameObject.name == "Building1"){
 129      ret = ret + GetBuilding1Name();
 730    }else if(gameObject.name == "Building2"){
 131      ret = ret + GetBuilding2Name();
 632    }else if(gameObject.name == "Building3"){
 133      ret = ret + GetBuilding3Name();
 534    }else if(gameObject.name == "Building4"){
 135      ret = ret + GetBuilding4Name();
 436    }else if(gameObject.name == "Building41"){
 137      ret = ret + GetBuilding41Name();
 338    }else if(gameObject.name == "Building42"){
 139      ret = ret + GetBuilding42Name();
 140    }else{
 041      ret = ret + "Unknown Apartment";
 042    }
 643    return ret;
 644  }
 45
 146  string GetBuilding1Name(){
 147    return "Saru Apartment";
 148  }
 49
 150  string GetBuilding2Name(){
 151    return "Usagi Apartment";
 152  }
 53
 154  string GetBuilding3Name(){
 155    return "Kumo Apartment";
 156  }
 57
 158  string GetBuilding4Name(){
 159    return "Neko Apartment";
 160  }
 61
 162  string GetBuilding41Name(){
 163    return "Inu Apartment";
 164  }
 65
 166  string GetBuilding42Name(){
 167    return "Tora Apartment";
 168  }
 69}