< Summary

Class:DCL.CommandLineParserUtils
Assembly:CommandLineParserUtils
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Desktop/Scripts/MainScripts/DCL/CommandLineParserDesktop/CommandLineParserUtils.cs
Covered lines:0
Uncovered lines:12
Coverable lines:12
Total lines:38
Line coverage:0% (0 of 12)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:2
Method coverage:0% (0 of 2)

Metrics

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

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Desktop/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 = 7666;
 011        public static bool withSSL = true;
 12
 13        public static void ParseArguments()
 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 "--port":
 027                            i++; // shift
 028                            startPort = int.Parse(arguments[i]);
 029                            break;
 30                        case "--no-ssl":
 031                            withSSL = false;
 32                            break;
 33                    }
 34                }
 35            }
 036        }
 37    }
 38}