asteris-llc/converge

View on GitHub

Showing 247 of 574 total issues

Method Preparer.Prepare has 5 return statements (exceeds 4 allowed).
Open

func (p *Preparer) Prepare(ctx context.Context, render resource.Renderer) (resource.Task, error) {
    if p.UID != nil && *p.UID == math.MaxUint32 {
        // the maximum uid on linux is MaxUint32 - 1
        return nil, fmt.Errorf("user \"uid\" parameter out of range")
    }
Severity: Major
Found in resource/user/preparer.go - About 35 mins to fix

    Method Preparer.Prepare has 5 return statements (exceeds 4 allowed).
    Open

    func (p *Preparer) Prepare(ctx context.Context, r Renderer) (Task, error) {
        value := reflect.ValueOf(p.Destination)
        typ := value.Type()
        wasPtr := false // so we can re-wrap later if we need to
    
    
    Severity: Major
    Found in resource/preparer.go - About 35 mins to fix

      Method User.DiffAdd has 5 return statements (exceeds 4 allowed).
      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: Major
      Found in resource/user/user.go - About 35 mins to fix

        Method Client.CreateContainer has 5 return statements (exceeds 4 allowed).
        Open

        func (c *Client) CreateContainer(opts dc.CreateContainerOptions) (*dc.Container, error) {
            name := opts.Name
        
            container, err := c.FindContainer(name)
            if err != nil {
        Severity: Major
        Found in resource/docker/docker.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 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 Printer.DrawEdge has 5 return statements (exceeds 4 allowed).
              Open

              func (p *Printer) DrawEdge(g *graph.Graph, id1, id2 string) (pp.Renderable, error) {
                  var srcVal, destVal interface{}
              
                  if src, ok := g.Get(id1); ok {
                      srcVal = src.Value()
              Severity: Major
              Found in prettyprinters/graphviz/graphviz.go - About 35 mins to fix

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

                func RenderPredicate(meta *node.Node, renderFunc func(string, string) (string, error)) (string, error) {
                    rendered, ok := meta.LookupMetadata(MetaRenderedPredicate)
                    if ok {
                        return rendered.(string), nil
                    }
                Severity: Major
                Found in graph/node/conditional/conditional.go - About 35 mins to fix

                  Method Graph.IsNibling has 5 return statements (exceeds 4 allowed).
                  Open

                  func (g *Graph) IsNibling(fst, snd string) bool {
                      sndID, sndHasParent := g.GetParentID(snd)
                      if !sndHasParent {
                          return false
                      }
                  Severity: Major
                  Found in graph/graph.go - About 35 mins to fix

                    Method Content.Check has 5 return statements (exceeds 4 allowed).
                    Open

                    func (t *Content) Check(context.Context, resource.Renderer) (resource.TaskStatus, error) {
                        diffs := make(map[string]resource.Diff)
                        contentDiff := resource.TextDiff{Values: [2]string{"", t.Content}}
                        stat, err := os.Stat(t.Destination)
                        if os.IsNotExist(err) {
                    Severity: Major
                    Found in resource/file/content/content.go - About 35 mins to fix

                      Method resourceLV.Apply has 5 return statements (exceeds 4 allowed).
                      Open

                      func (r *resourceLV) Apply(context.Context) (resource.TaskStatus, error) {
                          status := &Status{}
                          if _, err := r.checkVG(true); err != nil {
                              return nil, err
                          }
                      Severity: Major
                      Found in resource/lvm/lv/lv.go - About 35 mins to fix

                        Method resourceVG.Apply has 5 return statements (exceeds 4 allowed).
                        Open

                        func (r *resourceVG) Apply(context.Context) (status resource.TaskStatus, err error) {
                            if r.exists {
                                for _, d := range r.devicesToAdd {
                                    if err := r.lvm.ExtendVolumeGroup(r.name, d); err != nil {
                                        return nil, errors.Wrapf(err, "extending volume group")
                        Severity: Major
                        Found in resource/lvm/vg/vg.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

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

                            func getParams(g *graph.Graph, id string, node *parse.Node) (out []string, err error) {
                                var nodeStrings []string
                                nodeStrings, err = node.GetStrings()
                                if err != nil {
                                    return nil, err
                            Severity: Major
                            Found in load/dependencyresolver.go - About 35 mins to fix

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

                              func HTTP(ctx context.Context, loc string) ([]byte, error) {
                                  var client http.Client
                                  req, err := http.NewRequest("GET", loc, nil)
                                  if err != nil {
                                      return nil, err
                              Severity: Major
                              Found in fetch/http.go - About 35 mins to fix

                                Method resourceFS.Check has 5 return statements (exceeds 4 allowed).
                                Open

                                func (r *resourceFS) Check(context.Context, resource.Renderer) (resource.TaskStatus, error) {
                                    status := &resource.Status{}
                                
                                    if err := r.lvm.CheckFilesystemTools(r.mount.Type); err != nil {
                                        return nil, errors.Wrapf(err, "filesystem prerequisites for %s", r.mount.Type)
                                Severity: Major
                                Found in resource/lvm/fs/fs.go - About 35 mins to fix

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

                                  func (p *Printer) DrawNode(g *graph.Graph, id string) (pp.Renderable, error) {
                                      type printerNode struct {
                                          ID string
                                          *resource.HealthStatus
                                      }
                                  Severity: Major
                                  Found in prettyprinters/health/health.go - About 35 mins to fix

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

                                    func getXrefs(g *graph.Graph, id string, node *parse.Node) (out []string, err error) {
                                        var nodeStrings []string
                                        var calls []string
                                        nodeRefs := make(map[string]struct{})
                                        nodeStrings, err = node.GetStrings()
                                    Severity: Major
                                    Found in load/dependencyresolver.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

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

                                        func getParentSubgraph(subgraphs SubgraphMap, thisSubgraph SubgraphID, id string) SubgraphID {
                                            parent := graph.ParentID(id)
                                            if thisSubgraph == SubgraphBottomID {
                                                return SubgraphBottomID
                                            }
                                        Severity: Major
                                        Found in prettyprinters/subgraph_printer.go - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language