jkawamoto/loci

View on GitHub

Showing 24 of 61 total issues

Function parseMatrixPython has 5 return statements (exceeds 4 allowed).
Open

func parseMatrixPython(v interface{}) (version string, c TestCase, err error) {

    m, ok := v.(map[interface{}]interface{})
    if !ok {
        err = fmt.Errorf("Given item is broken.")
Severity: Major
Found in command/travis_python.go - About 35 mins to fix

    Function Build has 5 return statements (exceeds 4 allowed).
    Open

    func Build(ctx context.Context, dir, tag, version string, noCache bool, output io.Writer) (err error) {
    
        // Create a docker client.
        cli, err := client.NewEnvClient()
        if err != nil {
    Severity: Major
    Found in command/docker.go - About 35 mins to fix

      Function TestGoArgumentSetWithFullDescriptions has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
      Open

      func TestGoArgumentSetWithFullDescriptions(t *testing.T) {
      
          travis, err := storeAndLoadTravis(&Travis{
              Language: "go",
              Go:       []string{"1.6", "1.7"},
      Severity: Minor
      Found in command/travis_go_test.go - About 25 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 TestPythonArgumentSetWithFullDescriptions has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
      Open

      func TestPythonArgumentSetWithFullDescriptions(t *testing.T) {
      
          travis, err := storeAndLoadTravis(&Travis{
              Language: "python",
              Python:   []string{"2.7", "3.5"},
      Severity: Minor
      Found in command/travis_python_test.go - About 25 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

      Severity
      Category
      Status
      Source
      Language