kigster/secrets-cipher-base64

View on GitHub

Showing 27 of 31 total issues

Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

      def initialize(argv, stdin = $stdin, stdout = $stdout, stderr = $stderr, kernel = nil)
Severity: Minor
Found in lib/sym/app/cli.rb - About 35 mins to fix

    Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            def initialize(opts, stdin = $stdin, stdout = $stdout, stderr = $stderr, kernel = nil)
    Severity: Minor
    Found in lib/sym/app/output/base.rb - About 35 mins to fix

      Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def initialize(opts, stdin = $stdin, stdout = $stdout, stderr = $stderr, kernel = nil)
      Severity: Minor
      Found in lib/sym/application.rb - About 35 mins to fix

        Method error has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

                def error(exception = nil, message = nil)
                  if self.verbose
                    print 'WARNING: '
                    print message ? message.yellow : ''
                    print exception ? exception.message.red : ''
        Severity: Minor
        Found in lib/sym/app/password/cache.rb - About 35 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

        Method execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

                def execute
                  retries ||= 0
        
                  the_key = create_key
        
        
        Severity: Minor
        Found in lib/sym/app/commands/generate_key.rb - About 35 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

        Method initialize_key_source has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def initialize_key_source
              detect_key_source
              if args.require_key? && !self.key
                log :error, 'Unable to determine the key, which appears to be required with current args'
                raise Sym::Errors::NoPrivateKeyFound, "Private key is required when #{self.action ? "#{self.action.to_s}ypting" : provided_flags.join(', ')}"
        Severity: Minor
        Found in lib/sym/application.rb - About 35 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

        Method validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

                def validate(key)
                  if key
                    begin
                      decoded = Base64Decoder.new(key).key
                      decoded.length == 32 ? key : nil
        Severity: Minor
        Found in lib/sym/app/private_key/detector.rb - 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