< Summary

Class:DCL.CommandLineParserUtils
Assembly:CommandLineParserUtils
File(s):/tmp/workspace/explorer-desktop/unity-renderer-desktop/Assets/Scripts/MainScripts/DCL/CommandLineParserDesktop/CommandLineParserUtils.cs
Covered lines:0
Uncovered lines:16
Coverable lines:16
Total lines:43
Line coverage:0% (0 of 16)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
CommandLineParserUtils()0%2100%
ParseArguments()0%42600%

File(s)

/tmp/workspace/explorer-desktop/unity-renderer-desktop/Assets/Scripts/MainScripts/DCL/CommandLineParserDesktop/CommandLineParserUtils.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using System.IO;
 4using UnityEngine;
 5
 6namespace DCL
 7{
 8    public static class CommandLineParserUtils
 9    {
 010        public static int startPort = 5000;
 11        public static void ParseArguments()
 12        {
 013            var debugConfig = GameObject.Find("DebugConfig").GetComponent<DebugConfigComponent>();
 14
 015            var arguments = System.Environment.GetCommandLineArgs();
 16
 017            for (var i = 0; i < arguments.Length; ++i)
 18            {
 019                var argumentsLeft = arguments.Length - i - 1;
 020                var argument = arguments[i];
 21
 022                if (argumentsLeft >= 1) // Arguments with at least 1 parameter
 23                {
 24                    switch (argument)
 25                    {
 26                        case "--url-params":
 027                            i++; // shift
 028                            debugConfig.customURL += arguments[i] + "&";
 029                            break;
 30                        case "--browser":
 031                            i++; // shift
 032                            debugConfig.OpenBrowserOnStart = arguments[i] == "true";
 033                            break;
 34                        case "--port":
 035                            i++; // shift
 036                            startPort = int.Parse(arguments[i]);
 37                            break;
 38                    }
 39                }
 40            }
 041        }
 42    }
 43}