Showing 20 of 28 total issues
File rdot.rb
has 628 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'is/monkey/sandbox'
require 'is/monkey/namespace'
require 'rdot-common'
# @private
Method add_method
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def add_method acc, mod, scope, visibility, name, opts
m = get_method_object mod, scope, name
src = m.source_location
obj = {}
nm = name.to_s
- 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 diff_module
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def diff_module base, other, opts
if ! other
return base.merge :new => true
end
if opts[:show_preloaded]
- 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 get_module
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def get_module mod, opts
result = {}
result[:module] = mod
incs = mod.included_modules - [mod]
exts = mod.singleton_class.included_modules - Module.included_modules
- 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 dot_scope
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def dot_scope m, scope, opts
result = []
if m[scope]
if m[scope][:public]
if m[scope][:public][:attributes]
- 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 add_module
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def add_module acc, mod, opts
if opts[:exclude_classes]
opts[:exclude_classes].each do |c|
return nil if mod <= c
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 dot_scope
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dot_scope m, scope, opts
result = []
if m[scope]
if m[scope][:public]
if m[scope][:public][:attributes]
Method add_method
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_method acc, mod, scope, visibility, name, opts
m = get_method_object mod, scope, name
src = m.source_location
obj = {}
nm = name.to_s
Method dot
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dot space, opts = {}
opts = defaults.merge opts
result = []
result << 'digraph graph_RDot{'
result << ' graph['
Method get_module
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_module mod, opts
result = {}
result[:module] = mod
incs = mod.included_modules - [mod]
exts = mod.singleton_class.included_modules - Module.included_modules
Method dot_module
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def dot_module space, name, m, opts
if m == nil
# $stderr.puts "Warning: nil module by name \"#{name}\"!"
# return nil
m = get_module eval(name), no_scan: true
- 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 diff_module
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def diff_module base, other, opts
if ! other
return base.merge :new => true
end
if opts[:show_preloaded]
Method dot_module
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dot_module space, name, m, opts
if m == nil
# $stderr.puts "Warning: nil module by name \"#{name}\"!"
# return nil
m = get_module eval(name), no_scan: true
Method node_color
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def node_color m, opts
mod = m[:module]
stg = module_stage m
if Class === mod
if mod <= Exception
- 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 node_color
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def node_color m, opts
mod = m[:module]
stg = module_stage m
if Class === mod
if mod <= Exception
Method add_method
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_method acc, mod, scope, visibility, name, opts
Consider simplifying this complex logical expression. Open
unless other[s] && other[s][v] && other[s][v][k] &&
other[s][v][k][n] &&
other[s][v][k][n][:file] == m[:file] &&
other[s][v][k][n][:line] == m[:line]
result[s] ||= {}
Method register_attribute
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def register_attribute mod, scope, names, access, source
Avoid too many return
statements within this method. Open
return nil unless mod.global?
Method parse_caller
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_caller clr
clr.each do |s|
if s.include?('`<module:') || s.include?('`<class:') ||
s.include?("`singletonclass'") || s.include?('`block in <')
a = s.split(':')
- 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"