commander-cli/commander

View on GitHub

Showing 9 of 9 total issues

Method DockerExecutor.Execute has 94 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (e DockerExecutor) Execute(test TestCase) TestResult {
    log.Printf("DOCKER_HOST: %s \n", os.Getenv("DOCKER_HOST"))
    log.Printf("DOCKER_CERT_PATH: %s \n", os.Getenv("DOCKER_CERT_PATH"))
    log.Printf("DOCKER_API_VERSION: %s \n", os.Getenv("DOCKER_API_VERSION"))

Severity: Major
Found in pkg/runtime/docker_executor.go - About 2 hrs to fix

    Method YAMLSuiteConf.convertToExpectedOut has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring.
    Open

    func (y *YAMLSuiteConf) convertToExpectedOut(value interface{}) runtime.ExpectedOut {
        exp := runtime.ExpectedOut{
            JSON: make(map[string]string),
        }
    
    
    Severity: Minor
    Found in pkg/suite/yaml_suite.go - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method SSHExecutor.Execute has 70 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (e SSHExecutor) Execute(test TestCase) TestResult {
        if test.Command.InheritEnv {
            panic("Inherit env is not supported viá SSH")
        }
    
    
    Severity: Minor
    Found in pkg/runtime/ssh_executor.go - About 1 hr to fix

      Method YAMLSuiteConf.convertToExpectedOut has 62 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (y *YAMLSuiteConf) convertToExpectedOut(value interface{}) runtime.ExpectedOut {
          exp := runtime.ExpectedOut{
              JSON: make(map[string]string),
          }
      
      
      Severity: Minor
      Found in pkg/suite/yaml_suite.go - About 1 hr to fix

        Function validateExpectedOut has 52 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func validateExpectedOut(got string, expected ExpectedOut) matcher.MatcherResult {
            var m matcher.Matcher
            var result matcher.MatcherResult
            result.Success = true
        
        
        Severity: Minor
        Found in pkg/runtime/validator.go - About 1 hr to fix

          Function validateExpectedOut has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
          Open

          func validateExpectedOut(got string, expected ExpectedOut) matcher.MatcherResult {
              var m matcher.Matcher
              var result matcher.MatcherResult
              result.Success = true
          
          
          Severity: Minor
          Found in pkg/runtime/validator.go - About 55 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method Runner.Run has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
          Open

          func (r *Runner) Run(tests []TestCase) <-chan TestResult {
              in := make(chan TestCase)
              out := make(chan TestResult)
          
              go func(tests []TestCase) {
          Severity: Minor
          Found in pkg/runtime/runner.go - About 55 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function validateExpectedOut has 9 return statements (exceeds 4 allowed).
          Open

          func validateExpectedOut(got string, expected ExpectedOut) matcher.MatcherResult {
              var m matcher.Matcher
              var result matcher.MatcherResult
              result.Success = true
          
          
          Severity: Major
          Found in pkg/runtime/validator.go - About 55 mins to fix

            Method DockerExecutor.Execute has 5 return statements (exceeds 4 allowed).
            Open

            func (e DockerExecutor) Execute(test TestCase) TestResult {
                log.Printf("DOCKER_HOST: %s \n", os.Getenv("DOCKER_HOST"))
                log.Printf("DOCKER_CERT_PATH: %s \n", os.Getenv("DOCKER_CERT_PATH"))
                log.Printf("DOCKER_API_VERSION: %s \n", os.Getenv("DOCKER_API_VERSION"))
            
            
            Severity: Major
            Found in pkg/runtime/docker_executor.go - About 35 mins to fix
              Severity
              Category
              Status
              Source
              Language