CalebFenton/dex-oracle

View on GitHub

Showing 136 of 136 total issues

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

  def initialize(smali_dir, driver, include_types, exclude_types, disable_plugins)
Severity: Minor
Found in lib/oracle.rb - About 35 mins to fix

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

      def self.enumerate_files(dir, ext)
        # On Windows, filenames with unicode characters do not show up with Dir#glob or Dir#[]
        # They do, however, show up with Dir.entries, which is fine because it seems to be
        # the only Dir method that let's me set UTF-8 encoding. I must be missing something.
        # OH WELL. Do it the hard way.
    Severity: Minor
    Found in lib/oracle.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 exec has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

      def exec(cmd, silent = true)
        logger.debug("exec: #{cmd}")
    
        retries = 1
        begin
    Severity: Minor
    Found in lib/dex-oracle/driver.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

    Avoid parameter lists longer than 5 parameters. [7/5]
    Open

        matches.each do |original, _, encrypted, _, class_name, method_signature, out_reg|

    This cop checks for methods with too many parameters. The maximum number of parameters is configurable. Keyword arguments can optionally be excluded from the total count.

    Avoid too many return statements within this method.
    Open

                return short.class;
    Severity: Major
    Found in driver/src/main/java/org/cf/oracle/options/TargetParser.java - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return long.class;
      Severity: Major
      Found in driver/src/main/java/org/cf/oracle/options/TargetParser.java - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return boolean.class;
        Severity: Major
        Found in driver/src/main/java/org/cf/oracle/options/TargetParser.java - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return int.class;
          Severity: Major
          Found in driver/src/main/java/org/cf/oracle/options/TargetParser.java - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return byte.class;
            Severity: Major
            Found in driver/src/main/java/org/cf/oracle/options/TargetParser.java - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return void.class;
              Severity: Major
              Found in driver/src/main/java/org/cf/oracle/options/TargetParser.java - About 30 mins to fix

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

                    public static String binaryToInternal(String binaryName) {
                        String baseName = getComponentBase(binaryName);
                        StringBuilder sb = new StringBuilder();
                        int dimensionCount = getDimensionCount(binaryName);
                        for (int i = 0; i < dimensionCount; i++) {
                Severity: Minor
                Found in driver/src/main/java/org/cf/oracle/ClassNameUtils.java - 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

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

                  def self.which(cmd)
                    exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
                    ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
                      exts.each do |ext|
                        exe = File.join(path, "#{cmd}#{ext}")
                Severity: Minor
                Found in lib/dex-oracle/utility.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

                Avoid parameter lists longer than 5 parameters. [6/5]
                Open

                    matches.each do |original, _, class_index, class_name, method_signature, out_reg|

                This cop checks for methods with too many parameters. The maximum number of parameters is configurable. Keyword arguments can optionally be excluded from the total count.

                Avoid parameter lists longer than 5 parameters. [6/5]
                Open

                    matches.each do |original, _, str_index, class_name, method_signature, out_reg|

                This cop checks for methods with too many parameters. The maximum number of parameters is configurable. Keyword arguments can optionally be excluded from the total count.

                Avoid parameter lists longer than 5 parameters. [6/5]
                Open

                    matches.each do |original, encrypted, number, class_name, method_signature, out_reg|

                This cop checks for methods with too many parameters. The maximum number of parameters is configurable. Keyword arguments can optionally be excluded from the total count.

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

                  def self.extract_file(zip, name, dest)
                    Zip::File.open(zip) do |zf|
                      zf.each do |e|
                        next unless e.name == name
                        e.extract(dest) { true } # overwrite
                Severity: Minor
                Found in lib/dex-oracle/utility.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

                Avoid parameter lists longer than 5 parameters. [6/5]
                Open

                    matches.each do |original, _, encrypted, class_name, method_signature, out_reg|

                This cop checks for methods with too many parameters. The maximum number of parameters is configurable. Keyword arguments can optionally be excluded from the total count.

                Avoid parameter lists longer than 5 parameters. [6/5]
                Open

                    matches.each do |original, _, arg1, class_name, method_signature, out_reg|

                This cop checks for methods with too many parameters. The maximum number of parameters is configurable. Keyword arguments can optionally be excluded from the total count.

                Use || instead of or.
                Open

                      next if entry == '.' or entry == '..'
                Severity: Minor
                Found in lib/oracle.rb by rubocop

                This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

                Example: EnforcedStyle: always (default)

                # bad
                foo.save and return
                
                # bad
                if foo and bar
                end
                
                # good
                foo.save && return
                
                # good
                if foo && bar
                end

                Example: EnforcedStyle: conditionals

                # bad
                if foo and bar
                end
                
                # good
                foo.save && return
                
                # good
                foo.save and return
                
                # good
                if foo && bar
                end

                %w-literals should be delimited by [ and ].
                Open

                    out_dex = Tempfile.new(%w(oracle .dex)) if out_dex.nil?
                Severity: Minor
                Found in lib/dex-oracle/smali_input.rb by rubocop

                This cop enforces the consistent usage of %-literal delimiters.

                Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

                Example:

                # Style/PercentLiteralDelimiters:
                #   PreferredDelimiters:
                #     default: '[]'
                #     '%i':    '()'
                
                # good
                %w[alpha beta] + %i(gamma delta)
                
                # bad
                %W(alpha #{beta})
                
                # bad
                %I(alpha beta)
                Severity
                Category
                Status
                Source
                Language