ecadlabs/signatory

View on GitHub

Showing 91 of 102 total issues

File dict.go has 1596 lines of code (exceeds 500 allowed). Consider refactoring.
Open

package mnemonic

var adjectives = []string{
    "abandoned",
    "able",
Severity: Major
Found in pkg/vault/ledger/mnemonic/dict.go - About 3 days to fix

    Method azureIterator.Next has a Cognitive Complexity of 57 (exceeds 20 allowed). Consider refactoring.
    Open

    func (a *azureIterator) Next() (key vault.StoredKey, err error) {
        if a.done {
            return nil, vault.ErrDone
        }
    
    
    Severity: Minor
    Found in pkg/vault/azure/azure.go - About 6 hrs 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

    Method Vault.worker has a Cognitive Complexity of 53 (exceeds 20 allowed). Consider refactoring.
    Open

    func (v *Vault) worker() {
        var (
            dev *tezosapp.App
            err error
            t   *time.Timer
    Severity: Minor
    Found in pkg/vault/ledger/vault.go - About 5 hrs 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 Footer has 116 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function Footer() {
        const footerContainer = useRef(null);
        const [isActive, setIsActive] = useState(false);
        const { footer } = useThemeConfig();
        const { copyright, links = [], logo = {} } = footer || {};
    Severity: Major
    Found in website/src/theme/Footer/index.js - About 4 hrs to fix

      Method JWT.CheckUpdateNewCred has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring.
      Open

      func (j *JWT) CheckUpdateNewCred() error {
          for user, data := range j.Users {
              if data.NewData != nil {
                  if data.NewData.Password == data.Password || data.NewData.Secret == data.Secret {
                      return fmt.Errorf("JWT: new credentials are same as old for user %s", user)
      Severity: Minor
      Found in pkg/middlewares/jwt.go - About 4 hrs 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 ParseMap has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring.
      Open

      func ParseMap(s string, namevalSep, tuplesSep rune) (res map[string]string, err error) {
          res = make(map[string]string)
          p := []byte(s)
          for {
              p, err = eatSpace(p)
      Severity: Minor
      Found in pkg/utils/utils.go - About 3 hrs 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 validateSecretAndPass has a Cognitive Complexity of 39 (exceeds 20 allowed). Consider refactoring.
      Open

      func validateSecretAndPass(secret []string) error {
          var length int = 16
          var stype string = "password"
          for _, s := range secret {
              // Check length
      Severity: Minor
      Found in pkg/middlewares/jwt.go - About 3 hrs 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

      Method cloudKMSIterator.Next has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring.
      Open

      func (c *cloudKMSIterator) Next() (vault.StoredKey, error) {
          if c.keyIter == nil {
              return nil, vault.ErrDone
          }
      
      
      Severity: Minor
      Found in pkg/vault/cloudkms/cloudkms.go - About 3 hrs 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 NewRootCommand has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring.
      Open

      func NewRootCommand(c *Context, name string) *cobra.Command {
          var (
              level      string
              configFile string
              baseDir    string
      Severity: Minor
      Found in cmd/commands/root.go - About 2 hrs 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

      Method Server.Handler has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring.
      Open

      func (s *Server) Handler() (http.Handler, error) {
          pub := s.PrivateKey.Public()
          return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
              var req signatory.PolicyHookRequest
              dec := json.NewDecoder(r.Body)
      Severity: Minor
      Found in cmd/approve-list-svc/server/server.go - About 2 hrs 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

      Method Vault.Import has 90 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (c *Vault) Import(ctx context.Context, pk crypt.PrivateKey, opt utils.Options) (vault.StoredKey, error) {
          keyName, ok, err := opt.GetString("name")
          if err != nil {
              return nil, fmt.Errorf("(CloudKMS/%s): %w", c.config.keyRingName(), err)
          }
      Severity: Major
      Found in pkg/vault/cloudkms/cloudkms.go - About 2 hrs to fix

        Function NewRootCommand has 85 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func NewRootCommand(c *Context, name string) *cobra.Command {
            var (
                level      string
                configFile string
                baseDir    string
        Severity: Major
        Found in cmd/commands/root.go - About 2 hrs to fix

          Method Vault.worker has 81 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (v *Vault) worker() {
              var (
                  dev *tezosapp.App
                  err error
                  t   *time.Timer
          Severity: Major
          Found in pkg/vault/ledger/vault.go - About 2 hrs to fix

            Function NewServeCommand has 76 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func NewServeCommand(c *Context) *cobra.Command {
                var noList bool
            
                serveCmd := cobra.Command{
                    Use:   "serve",
            Severity: Major
            Found in cmd/commands/serve.go - About 2 hrs to fix

              Method azureIterator.Next has 72 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func (a *azureIterator) Next() (key vault.StoredKey, err error) {
                  if a.done {
                      return nil, vault.ErrDone
                  }
              
              
              Severity: Minor
              Found in pkg/vault/azure/azure.go - About 1 hr to fix

                Function Feature has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function Feature() {
                    const { error, loading, status, subscribe, message } = useMailChimp({
                        action: `https://ecadlabs.us20.list-manage.com/subscribe/post?u=8fdd00e1ab81d5f5550fadb32&id=de1bfb4af9`,
                    });
                
                
                Severity: Minor
                Found in website/src/components/FooterForm/FooterForm.js - About 1 hr to fix

                  Method Server.Handler has 65 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (s *Server) Handler() (http.Handler, error) {
                      pub := s.PrivateKey.Public()
                      return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
                          var req signatory.PolicyHookRequest
                          dec := json.NewDecoder(r.Body)
                  Severity: Minor
                  Found in cmd/approve-list-svc/server/server.go - About 1 hr to fix

                    Function NewServeCommand has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
                    Open

                    func NewServeCommand(c *Context) *cobra.Command {
                        var noList bool
                    
                        serveCmd := cobra.Command{
                            Use:   "serve",
                    Severity: Minor
                    Found in cmd/commands/serve.go - About 1 hr 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 ParseMap has 64 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func ParseMap(s string, namevalSep, tuplesSep rune) (res map[string]string, err error) {
                        res = make(map[string]string)
                        p := []byte(s)
                        for {
                            p, err = eatSpace(p)
                    Severity: Minor
                    Found in pkg/utils/utils.go - About 1 hr to fix

                      Method JWK.PrivateKey has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func (j *JWK) PrivateKey() (crypto.PrivateKey, error) {
                          switch j.KeyType {
                          case "EC", "EC-HSM":
                              if j.D == "" {
                                  return nil, ErrPublic
                      Severity: Minor
                      Found in pkg/vault/azure/jwk/jwk.go - About 1 hr 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