pedroMMM/goss

View on GitHub

Showing 439 of 439 total issues

Function RenderJSON has 6 return statements (exceeds 4 allowed).
Open

func RenderJSON(c *RuntimeConfig) (string, error) {
    var err error
    debug = c.Debug
    currentTemplateFilter, err = NewTemplateFilter(c.Vars, c.VarsInline)
    if err != nil {
Severity: Major
Found in store.go - About 40 mins to fix

    Function lookupUserGroups has 6 return statements (exceeds 4 allowed).
    Open

    func lookupUserGroups(userS user.User) ([]user.Group, error) {
        // Get operating system-specific group reader-closer.
        group, err := user.GetGroup()
        if err != nil {
            return []user.Group{user.Group{}}, err
    Severity: Major
    Found in system/user.go - About 40 mins to fix

      Function ValidateContains has 6 return statements (exceeds 4 allowed).
      Open

      func ValidateContains(res ResourceRead, property string, expectedValues []string, method func() (io.Reader, error), skip bool) TestResult {
          id := res.ID()
          title := res.GetTitle()
          meta := res.GetMeta()
          typ := reflect.TypeOf(res)
      Severity: Major
      Found in resource/validate.go - About 40 mins to fix

        Function ValidateValue has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func ValidateValue(res ResourceRead, property string, expectedValue interface{}, actual interface{}, skip bool) TestResult {
        Severity: Minor
        Found in resource/validate.go - About 35 mins to fix

          Function ValidateContains has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func ValidateContains(res ResourceRead, property string, expectedValues []string, method func() (io.Reader, error), skip bool) TestResult {
          Severity: Minor
          Found in resource/validate.go - About 35 mins to fix

            Function AddResource has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            func AddResource(fileName string, gossConfig GossConfig, resourceName, key string, config util.Config, sys *system.System) error {
            Severity: Minor
            Found in add.go - About 35 mins to fix

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

              func NewTemplateFilter(varsFile string, varsInline string) (func([]byte) ([]byte, error), error) {
                  vars, err := loadVars(varsFile, varsInline)
                  if err != nil {
                      return nil, fmt.Errorf("failed while loading vars file %q: %v", varsFile, err)
                  }
              Severity: Major
              Found in template.go - About 35 mins to fix

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

                func shouldSkip(results []TestResult) bool {
                    if len(results) < 1 {
                        return false
                    }
                    if results[0].Err != nil {
                Severity: Major
                Found in resource/resource.go - About 35 mins to fix

                  Method MatchingMap.UnmarshalYAML has 5 return statements (exceeds 4 allowed).
                  Open

                  func (ret *MatchingMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
                      // Validate configuration
                      zero := Matching{}
                      whitelist, err := util.WhitelistAttrs(zero, util.YAML)
                      if err != nil {
                  Severity: Major
                  Found in resource/matching.go - About 35 mins to fix

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

                    func toVersions(in interface{}) ([]*semver.Version, bool) {
                        if v, ok := toVersion(in); ok {
                            return []*semver.Version{v}, ok
                        }
                    
                    
                    Severity: Major
                    Found in matchers/semver_constraint.go - About 35 mins to fix

                      Method DefFile.Filetype has 5 return statements (exceeds 4 allowed).
                      Open

                      func (f *DefFile) Filetype() (string, error) {
                          if err := f.setup(); err != nil {
                              return "", err
                          }
                      
                      
                      Severity: Major
                      Found in system/file.go - About 35 mins to fix

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

                        func varsFromFile(varsFile string) (map[string]interface{}, error) {
                            vars := make(map[string]interface{})
                            if varsFile == "" {
                                return vars, nil
                            }
                        Severity: Major
                        Found in store.go - About 35 mins to fix

                          Method ResourceTypeMap.UnmarshalYAML has 5 return statements (exceeds 4 allowed).
                          Open

                          func (ret *ResourceTypeMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
                              // Validate configuration
                              zero := ResourceType{}
                              whitelist, err := util.WhitelistAttrs(zero, util.YAML)
                              if err != nil {
                          Severity: Major
                          Found in resource/resource_list_genny.go - About 35 mins to fix

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

                            func WriteJSON(filePath string, gossConfig GossConfig) error {
                                jsonData, err := marshal(gossConfig)
                                if err != nil {
                                    return fmt.Errorf("failed to write %s: %s", filePath, err)
                                }
                            Severity: Major
                            Found in store.go - About 35 mins to fix

                              exported method BeSemverConstraintMatcher.NegatedFailureMessage should have comment or be unexported
                              Open

                              func (matcher *BeSemverConstraintMatcher) NegatedFailureMessage(actual interface{}) (message string) {
                              Severity: Minor
                              Found in matchers/semver_constraint.go by golint

                              type JsonOneline should be JSONOneline
                              Open

                              type JsonOneline struct{}
                              Severity: Minor
                              Found in outputs/json_oneline.go by golint

                              exported function FormatOptions should have comment or be unexported
                              Open

                              func FormatOptions() []string {
                              Severity: Minor
                              Found in outputs/outputs.go by golint

                              exported method Rspecish.Output should have comment or be unexported
                              Open

                              func (r Rspecish) Output(w io.Writer, results <-chan []resource.TestResult,
                              Severity: Minor
                              Found in outputs/rspecish.go by golint

                              exported method Command.Validate should have comment or be unexported
                              Open

                              func (c *Command) Validate(sys *system.System) []TestResult {
                              Severity: Minor
                              Found in resource/command.go by golint

                              exported method DNS.ID should have comment or be unexported
                              Open

                              func (d *DNS) ID() string      { return d.Host }
                              Severity: Minor
                              Found in resource/dns.go by golint
                              Severity
                              Category
                              Status
                              Source
                              Language