Showing 191 of 268 total issues
File compiler.rb
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Pione
module PNML
class Compiler
# Compile from the net to PIONE document.
#
Class LocalLocation
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class LocalLocation < DataLocation
set_scheme "local"
define(:need_caching, false)
define(:real_appendable, true)
Class FTPLocation
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class FTPLocation < DataLocation
set_scheme "ftp"
define(:need_caching, true)
define(:real_appendable, false)
Method exist_output_data?
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def exist_output_data?(env, rule_condition, inputs, outputs, data_null_tuples)
result = false
rule_condition.outputs.each_with_index do |condition, i|
_condition = condition.eval(env)
# remove
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
def self.find_subjects(net, env)
net.places.each do |place|
# source 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 eliminate_blocking_feature
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def eliminate_blocking_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
File environment.rb
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Pione
module Lang
# DelegatableTable is a value table identified by two keys(package id and name).
class DelegatableTable
def initialize(parent, table=Hash.new {|h, k| h[k] = Hash.new})
Class Environment
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Environment < StructX
immutable true
# variable table
member :variable_table, default: lambda {|env| VariableTable.new(nil)}
Method find_subjects
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.find_subjects(net, env)
net.transitions.each do |transition|
# source transition should have no names
next unless Perspective.empty_transition?(env, transition)
- 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 a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def accept
while true
soc = @proxy_socket.accept
break if (@acl ? @acl.allow_socket?(soc) : true)
soc.close
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
def self.find_subjects(net, env)
net.places.each do |place|
# source 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_all_by_tree_names
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def find_all_by_tree_names(parsed, names)
list = []
return list if parsed.nil?
parsed.each do |key, 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
Class Net
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Net < StructX
# all places in the net
member :places, :default => lambda{ Array.new }
# all transitions in the net
Class TupleSpace
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class TupleSpace
attr_reader :bag
attr_reader :take_waiter
attr_reader :read_waiter
Method find_subjects
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def self.find_subjects(net, env)
net.transitions.each do |transition|
# target transition should be empty
next unless Perspective.empty_transition?(env, transition)
- 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_running
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def start_running(transition, result, state, free)
thread = free ? Util::FreeThreadGenerator.method(:generate) : Thread.method(:new)
thread.call do
begin
Thread.current[:agent_state] = state
- 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_move
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def real_move(port, tuple, sec=nil)
template = WaitTemplateEntry.new(self, tuple, sec)
yield(template) if block_given?
if entry = @mutex.synchronize {@bag.find(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 find_tasks_by_rule_condition
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def find_tasks_by_rule_condition(env, rule, rule_definition, rule_condition, param_set)
tasks = []
# find input data combinations
@data_finder.find(:input, rule_condition.inputs, env) do |task_env, inputs|
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
def self.find_subjects(net, env)
net.transitions.each do |transition|
# transition should be a rule
next unless Perspective.rule_transition?(env, transition)
- 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 convert
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def self.convert(type, val)
case type
when :string
val = val.to_s unless val.kind_of?(String)
when :integer
- 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"