Showing 268 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.
      #
Severity: Minor
Found in lib/pione/pnml/compiler.rb - About 2 hrs to fix

    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)
    Severity: Minor
    Found in lib/pione/location/local-location.rb - About 2 hrs to fix

      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)
      Severity: Minor
      Found in lib/pione/location/ftp-location.rb - About 2 hrs to fix

        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
        Severity: Minor
        Found in lib/pione/rule-engine/update-criteria.rb - About 2 hrs to fix

        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)
        
        
        Severity: Minor
        Found in lib/pione/pnml/output-reduction.rb - About 2 hrs to fix

        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|
        Severity: Minor
        Found in lib/pione/lang/feature-expr.rb - About 2 hrs to fix

        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})
        Severity: Minor
        Found in lib/pione/lang/environment.rb - About 2 hrs to fix

          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)}
          Severity: Minor
          Found in lib/pione/lang/environment.rb - About 2 hrs to fix

            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)
            
            
            Severity: Minor
            Found in lib/pione/pnml/input-parallelization-complement.rb - About 2 hrs to fix

            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
            Severity: Minor
            Found in lib/pione/relay/transmitter-socket.rb - About 2 hrs to fix

            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)
            
            
            Severity: Minor
            Found in lib/pione/pnml/output-decomposition-complement.rb - About 2 hrs to fix

            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|
            Severity: Minor
            Found in lib/pione/pnml/label-extractor.rb - About 2 hrs to fix

            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
            Severity: Minor
            Found in lib/pione/pnml/pnml-model.rb - About 2 hrs to fix

              Class TupleSpace has 21 methods (exceeds 20 allowed). Consider refactoring.
              Open

                class TupleSpace
                  attr_reader :bag
                  attr_reader :take_waiter
                  attr_reader :read_waiter
              
              
              Severity: Minor
              Found in lib/pione/patch/rinda-patch.rb - About 2 hrs to fix

                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)
                
                
                Severity: Minor
                Found in lib/pione/pnml/output-synchronization-complement.rb - About 2 hrs to fix

                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
                Severity: Minor
                Found in lib/pione/agent/basic-agent.rb - About 2 hrs to fix

                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)}
                Severity: Minor
                Found in lib/pione/patch/rinda-patch.rb - About 2 hrs to fix

                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|
                Severity: Minor
                Found in lib/pione/rule-engine/flow-handler.rb - About 1 hr to fix

                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)
                
                
                Severity: Minor
                Found in lib/pione/pnml/io-expansion.rb - About 1 hr to fix

                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
                Severity: Minor
                Found in lib/pione/global/item.rb - About 1 hr to fix

                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

                Severity
                Category
                Status
                Source
                Language