ipfs/ipfs-cluster

View on GitHub
cmd/ipfs-cluster-ctl/main.go

Summary

Maintainability
F
1 wk
Test Coverage

Function main has 923 lines of code (exceeds 80 allowed). Consider refactoring.
Open

func main() {
    ctx := context.Background()

    app := cli.NewApp()
    app.Name = programName
Severity: Major
Found in cmd/ipfs-cluster-ctl/main.go - About 4 days to fix

    Function main has a Cognitive Complexity of 125 (exceeds 15 allowed). Consider refactoring.
    Open

    func main() {
        ctx := context.Background()
    
        app := cli.NewApp()
        app.Name = programName
    Severity: Minor
    Found in cmd/ipfs-cluster-ctl/main.go - About 2 days 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

    File main.go has 1118 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    // The ipfs-cluster-ctl application.
    package main
    
    import (
        "context"
    Severity: Major
    Found in cmd/ipfs-cluster-ctl/main.go - About 2 days to fix

      Function main has 25 return statements (exceeds 10 allowed).
      Open

      func main() {
          ctx := context.Background()
      
          app := cli.NewApp()
          app.Name = programName
      Severity: Major
      Found in cmd/ipfs-cluster-ctl/main.go - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status