jkawamoto/loci

View on GitHub

Showing 24 of 61 total issues

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

    Method Display.Layout has 5 return statements (exceeds 4 allowed).
    Open

    func (d *Display) Layout(g *gocui.Gui) error {
        if d.closed {
            return fmt.Errorf("Display has been closed already")
        }
    
    
    Severity: Major
    Found in command/display.go - About 35 mins to fix

      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

      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

      Severity
      Category
      Status
      Source
      Language