Class has too many lines. [270/250] Open
class Pods
PODS_ROOT = 'vendor/Pods'
TARGET_NAME = 'RubyMotion'
PUBLIC_HEADERS_ROOT = File.join(PODS_ROOT, 'Headers/Public')
PODS_ROOT_MATCHER = /(\$\(PODS_ROOT\))|(\$\{PODS_ROOT\})/
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Class Pods
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class Pods
PODS_ROOT = 'vendor/Pods'
TARGET_NAME = 'RubyMotion'
PUBLIC_HEADERS_ROOT = File.join(PODS_ROOT, 'Headers/Public')
PODS_ROOT_MATCHER = /(\$\(PODS_ROOT\))|(\$\{PODS_ROOT\})/
File main.rb
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Motion
class Pods
PODS_ROOT = 'vendor/Pods'
TARGET_NAME = 'RubyMotion'
PUBLIC_HEADERS_ROOT = File.join(PODS_ROOT, 'Headers/Public')
Method resources
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def resources
resources = []
resource_path =
Pathname.new(@config.project_dir) +
SUPPORT_FILES +
- 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 framework_search_paths
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def framework_search_paths
search_paths = xcconfig_hash["FRAMEWORK_SEARCH_PATHS"]
return [] unless search_paths
- 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 install_resource
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def install_resource(file, resources_dir)
FileUtils.cp_r(file, resources_dir) if file.exist?
rescue ArgumentError => exc
raise unless exc.message =~ /same file/
end
- 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 parsed_library_path
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parsed_library_path(library, lib_search_path_flags)
lib_name = library[0]
return unless lib_name
- 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
TODO found Open
# TODO: this probably breaks in cases like resource bundles etc, need to test.
- Exclude checks
TODO found Open
# TODO: replace this all once Xcodeproj has the proper xcconfig parser.
- Exclude checks
Use ==
if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition. Open
if cocoapods_config.verbose = !!ENV["COCOAPODS_VERBOSE"]
- Read upRead up
- Exclude checks
This cop checks for assignments in the conditions of if/while/until.
Example:
# bad
if some_var = true
do_something
end
Example:
# good
if some_var == true
do_something
end