< Summary

Class:WebServerComponent
Assembly:MainScripts
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/Debugging/WebServerComponent.cs
Covered lines:0
Uncovered lines:14
Coverable lines:14
Total lines:39
Line coverage:0% (0 of 14)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Awake()0%6200%
Restart()0%6200%
OnDestroy()0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/Debugging/WebServerComponent.cs

#LineLine coverage
 1using UnityEngine;
 2
 3public class WebServerComponent : MonoBehaviour
 4{
 5    static SimpleHTTPServer _server;
 6    string wwwPath;
 7    const int PORT = 9991;
 8
 9    void Awake()
 10    {
 011        if (_server == null)
 12        {
 013            var appPath = Application.dataPath;
 014            wwwPath = appPath + "/TestWebserverRoot";
 015            _server = new SimpleHTTPServer(wwwPath, PORT);
 016            Debug.Log("Starting web server... (" + wwwPath + ")");
 17        }
 018    }
 19
 20    public void Restart()
 21    {
 022        if (_server == null)
 23        {
 024            Awake();
 025        }
 26        else
 27        {
 028            _server.Restart(wwwPath, PORT);
 29        }
 030    }
 31
 32    void OnDestroy()
 33    {
 034        if (_server == null)
 35        {
 036            _server.Stop();
 37        }
 038    }
 39}

Methods/Properties

Awake()
Restart()
OnDestroy()