Showing 191 of 268 total issues
File rinda-patch.rb
has 609 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Rinda
class RedundantTupleError < StandardError
def initialize(tuple)
@tuple = tuple
end
File pione-model.rb
has 495 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Pione
module PNML
# `Perspective` is a meta class for PIONE's concepts overlayed in PNML.
class Perspective
TRANSFORMER_OPT = {package_name: "", editor: "", tag: "", filename: ""}
File pione-client.rb
has 487 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Pione
module Command
# PioneClient is a command to request processing.
class PioneClient < BasicCommand
include TupleSpace::TupleSpaceInterface
Class DataLocation
has 41 methods (exceeds 20 allowed). Consider refactoring. Open
class DataLocation < BasicLocation
location_type :data
KNOWN_ATTRS = [:need_caching, :real_appendable, :writable]
Method not_exist_output_data?
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def not_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)
if _condition.operation == :write or _condition.operation == :touch
- 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 drb-patch.rb
has 376 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Pione
module DRbPatch
#
# special protocol
#
Method show_bag
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def show_bag(tuple_space, type)
tuple_space.all_tuples(type).each do |tuple|
next if not(option[:identifiers].empty?) and not(option[:identifiers].include?(tuple.first.to_s))
next if option[:exclusions].include?(tuple.first.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
Class Perspective
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class Perspective
TRANSFORMER_OPT = {package_name: "", editor: "", tag: "", filename: ""}
class << self
# Return true if the node is empty.
Method initialize
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def initialize(*data)
@data = {}
return if data.empty?
format = self.class.format
- 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
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def eliminate_requisite_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 flow-handler.rb
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Pione
module RuleEngine
# FlowHandler is a rule handler for flow elements.
class FlowHandler < BasicHandler
# Start to process flow elements.
File ftp-server.rb
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Pione
module Util
# FTPAuthInfo is a class for FTP authentication information.
class FTPAuthInfo
attr_reader :user
File core.rb
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Rootage
# `Item` is an atomic unit of Rootage, for holding infomations and processes.
class Item < StructX
# `name` is item name. This is used as a reference at controller.
member :name
Class DropboxLocation
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class DropboxLocation < DataLocation
set_scheme "dropbox"
define(:need_caching, true)
define(:real_appendable, false)
Method accept
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def accept
begin
# accept loop
while true
soc = @socket.accept
- 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 a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def analyze_response(stdout)
cgi_response = CGIResponse.new
if nph?
cgi_response.nph = 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 transit
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def transit(transition, transition_inputs)
# wake up threads that wait by wait_until_before method
if @__wait_until_before_cv__.has_key?(transition)
@__wait_until_before_mutex__.synchronize do
@__wait_until_before_cv__[transition].broadcast
- 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 spec
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def spec(rb, context, parser=Pione::Lang::DocumentParser)
basename = File.basename(rb, ".rb")
path = File.join(File.dirname(rb), "data", basename[5..-1] + ".yml")
YAML.load(File.read(path)).each do |name, testcase|
context.describe name do
- 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 20 (exceeds 5 allowed). Consider refactoring. Open
def self.find_subjects(net, env)
net.transitions.each do |rule|
# rule has its name
next if Perspective.empty?(env, rule)
- 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 spawn
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def spawn
Log::Debug.system('process "%{name}" is spawned with arguments %{argv}' % {name: @name, argv: @argv})
# create a new process and watch it
@pid = Process.spawn(@name, *@argv)
- 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"