Showing 191 of 268 total issues
Method each_rel_entry
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def each_rel_entry(option={rec: false}, &b)
if block_given?
@path.each_entry do |entry|
# ignore current or parent directory
next if entry.to_s == "." or entry.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 eliminate_possible_feature
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def eliminate_possible_feature(provider_piece, request_piece)
ppieces = provider_piece.is_a?(CompoundFeature) ? provider_piece.pieces : [provider_piece]
rpieces = request_piece.is_a?(CompoundFeature) ? request_piece.pieces : [request_piece]
ppieces.each do |ppiece|
- 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 accept
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def accept
begin
# accept loop
while true
soc = @socket.accept
Method open
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def open(remote_uri)
conn = nil
@mutex.synchronize do
cache = @cache[remote_uri]
- 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 find_head_character_position
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def find_head_character_position(parsed)
return nil if parsed.nil?
pos = nil
parsed.values.each do |value|
- 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 analyze_response
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def analyze_response(stdout)
cgi_response = CGIResponse.new
if nph?
cgi_response.nph = true
Method chain
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def chain(data)
data.each do |k, v|
raise ArgumentError.new(k) if not(@transitions.include?(k))
if not(v.is_a?(Proc))
(v.is_a?(Array) ? v : [v]).each do |_v|
- 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 real_take_all
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def real_take_all(tuple, sec=nil)
template = WaitTemplateEntry.new(self, tuple, sec)
yield(template) if block_given?
entries = @mutex.synchronize {@bag.find_all(template)}
- 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 start_readline
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def start_readline
buf = ""
mark = ">"
# start loop
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
def exec
unless @cgi_path.exist?
raise CGIError.not_exist(@cgi_path)
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 try_to_eval
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def try_to_eval(env, elts)
return if elts.empty?
exception = nil
next_elts = []
- 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 eliminate_requisite_feature_by_almighty_feature
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def eliminate_requisite_feature_by_almighty_feature(provider_piece, request_piece)
ppieces = provider_piece.is_a?(CompoundFeature) ? provider_piece.pieces : [provider_piece]
rpieces = request_piece.is_a?(CompoundFeature) ? request_piece.pieces : [request_piece]
rpieces.each do |rpiece|
- 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 open
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.open(uri, config)
host, port, option = parse_uri(uri)
host.untaint
port.untaint
Method terminate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def terminate
timeout(3) do
while @thread.alive?
if @queue.empty? and not(@lock.locked?)
@thread.kill.join
- 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 main_loop
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def main_loop
if @protocol.uri =~ /^receiver:/
RequestLooper.start(self, @protocol)
@thread.kill.join # stop transceiver
else
- 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 address_to_uri
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def address_to_uri(address, default_host, default_port)
uri = URI.parse(address)
unless ["pnb", "pnm", "pnu"].include?(uri.scheme)
raise URI::InvalidURIError
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 data_modifier
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def data_modifier(env, node)
if node.kind_of?(Place) and not(node.name.nil?)
begin
parsed = Parser.new.data_place.parse(node.name)
if parsed.kind_of?(Hash)
- 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 find_subjects
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.find_subjects(net, env)
net.places.each do |place|
# target place should be empty
next unless Perspective.empty_place?(env, place)
- 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 find_parents
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def find_parents(annotations)
annotations.each_with_object([]) do |annotation, parents|
if annotation.annotation_type == "Parent"
annotation.pieces.each do |parent|
name = parent.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
Method get_reference
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_reference(env, name, expected)
# evaluate the name expression if it has unexpected type
# e.g. "$p.var($x) := 1"
unless name.is_a?(expected)
name = name.eval(env)
- 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"