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 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

    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

    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

        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 long.class;
          Severity: Major
          Found in driver/src/main/java/org/cf/oracle/options/TargetParser.java - About 30 mins to fix

            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 boolean.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

                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.

                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.

                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, _, 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.

                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

                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, _, 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.

                Do not use semicolons to terminate expressions.
                Open

                    optimizations = optimizations.inject(Hash.new(0)) { |memo, subhash| subhash.each { |prod, value| memo[prod] += value } ; memo }
                Severity: Minor
                Found in lib/oracle.rb by rubocop

                This cop checks for multiple expressions placed on the same line. It also checks for lines terminated with a semicolon.

                Example:

                # bad
                foo = 1; bar = 2;
                baz = 3;
                
                # good
                foo = 1
                bar = 2
                baz = 3

                Missing magic comment # frozen_string_literal: true.
                Open

                require_relative '../logging'

                This cop is designed to help upgrade to Ruby 3.0. It will add the comment # frozen_string_literal: true to the top of files to enable frozen string literals. Frozen string literals may be default in Ruby 3.0. The comment will be added below a shebang and encoding comment. The frozen string literal comment is only valid in Ruby 2.3+.

                Example: EnforcedStyle: when_needed (default)

                # The `when_needed` style will add the frozen string literal comment
                # to files only when the `TargetRubyVersion` is set to 2.3+.
                # bad
                module Foo
                  # ...
                end
                
                # good
                # frozen_string_literal: true
                
                module Foo
                  # ...
                end

                Example: EnforcedStyle: always

                # The `always` style will always add the frozen string literal comment
                # to a file, regardless of the Ruby version or if `freeze` or `<<` are
                # called on a string literal.
                # bad
                module Bar
                  # ...
                end
                
                # good
                # frozen_string_literal: true
                
                module Bar
                  # ...
                end

                Example: EnforcedStyle: never

                # The `never` will enforce that the frozen string literal comment does
                # not exist in a file.
                # bad
                # frozen_string_literal: true
                
                module Baz
                  # ...
                end
                
                # good
                module Baz
                  # ...
                end
                Severity
                Category
                Status
                Source
                Language