asteris-llc/converge

View on GitHub

Showing 247 of 615 total issues

Method Printer.drawSubgraph has 5 return statements (exceeds 4 allowed).
Open

func (p Printer) drawSubgraph(g *graph.Graph, id SubgraphID, subgraph Subgraph) (Renderable, error) {
    subgraphPrinter, spOK := p.pp.(SubgraphPrinter)
    nodePrinter, npOK := p.pp.(NodePrinter)

    if !spOK && !npOK {
Severity: Major
Found in prettyprinters/subgraph_printer.go - About 35 mins to fix

    Method Keystore.StoreTrustedKey has 5 return statements (exceeds 4 allowed).
    Open

    func (ks *Keystore) StoreTrustedKey(pubkeyBytes []byte) (string, error) {
        if err := os.MkdirAll(ks.UserPath, 0755); err != nil {
            return "", err
        }
    
    
    Severity: Major
    Found in keystore/keystore.go - About 35 mins to fix

      Method Printer.drawEdges has 5 return statements (exceeds 4 allowed).
      Open

      func (p Printer) drawEdges(g *graph.Graph) (Renderable, error) {
          edgePrinter, epOK := p.pp.(EdgePrinter)
          edgeSectionPrinter, espOK := p.pp.(EdgeSectionPrinter)
      
          if !epOK && !espOK {
      Severity: Major
      Found in prettyprinters/prettyprinter.go - About 35 mins to fix

        Method Keystore.CheckSignature has 5 return statements (exceeds 4 allowed).
        Open

        func (ks *Keystore) CheckSignature(signed, signature io.Reader) error {
            if ks.keyring == nil {
                keyring, err := loadKeyring(ks)
                if err != nil {
                    return errors.Wrap(err, "error loading keyring")
        Severity: Major
        Found in keystore/keystore.go - About 35 mins to fix

          Method pipelineGen.DependencyCheck has 5 return statements (exceeds 4 allowed).
          Open

          func (g *pipelineGen) DependencyCheck(ctx context.Context, taskI interface{}) (interface{}, error) {
              result, ok := taskI.(resultWrapper)
              if !ok {
                  return nil, errors.New("input node is not a task wrapper")
              }
          Severity: Major
          Found in apply/pipeline.go - About 35 mins to fix

            Method User.DiffAdd has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
            Open

            func (u *User) DiffAdd(status *resource.Status) (*AddUserOptions, error) {
                options := new(AddUserOptions)
            
                // if a group exists with the same name as the user being added, a groupname
                // must also be indicated so the user may be added to that group
            Severity: Minor
            Found in resource/user/user.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 ResolveDependencies has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
            Open

            func ResolveDependencies(ctx context.Context, g *graph.Graph) (*graph.Graph, error) {
                logger := logging.GetLogger(ctx).WithField("function", "ResolveDependencies")
                logger.Debug("resolving dependencies")
            
                groupLock := new(sync.Mutex)
            Severity: Minor
            Found in load/dependencyresolver.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