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)
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.
- Read upRead up
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
- Read upRead up
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|
- Read upRead up
- Exclude checks
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;
Avoid too many return
statements within this method. Open
return long.class;
Avoid too many return
statements within this method. Open
return boolean.class;
Avoid too many return
statements within this method. Open
return int.class;
Avoid too many return
statements within this method. Open
return byte.class;
Avoid too many return
statements within this method. Open
return void.class;
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++) {
- Read upRead up
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}")
- Read upRead up
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|
- Read upRead up
- Exclude checks
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|
- Read upRead up
- Exclude checks
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|
- Read upRead up
- Exclude checks
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
- Read upRead up
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|
- Read upRead up
- Exclude checks
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|
- Read upRead up
- Exclude checks
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 == '..'
- Read upRead up
- Exclude checks
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?
- Read upRead up
- Exclude checks
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)