thrawn01/args

View on GitHub
rules.go

Summary

Maintainability
A
2 hrs
Test Coverage

Method Rule.ComputedValue has 8 return statements (exceeds 4 allowed).
Open

func (self *Rule) ComputedValue(values *Options) (interface{}, error) {
    if self.Count != 0 {
        self.Value = self.Count
    }

Severity: Major
Found in rules.go - About 50 mins to fix

    Method Rule.Match has 7 return statements (exceeds 4 allowed).
    Open

    func (self *Rule) Match(args []string, idx *int) (bool, error) {
        name := self.Name
        var matched bool
    
        if self.HasFlag(IsConfig) {
    Severity: Major
    Found in rules.go - About 45 mins to fix

      Method Rule.GenerateUsage has 5 return statements (exceeds 4 allowed).
      Open

      func (self *Rule) GenerateUsage() string {
          switch {
          case self.Flags&IsOption != 0:
              if self.HasFlag(IsRequired) {
                  return fmt.Sprintf("%s", self.Aliases[0])
      Severity: Major
      Found in rules.go - About 35 mins to fix

        TODO found
        Open

            // TODO: Move this logic from here, This method should be all about getting the value
        Severity: Minor
        Found in rules.go by fixme

        TODO found
        Open

            // TODO: This sort should happen when we validate rules
        Severity: Minor
        Found in rules.go by fixme

        TODO found
        Open

            // TODO: Move this logic from here, This method should be all about getting the value
        Severity: Minor
        Found in rules.go by fixme

        There are no issues that match your filters.

        Category
        Status