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
Severity: Major
Found in lib/pione/patch/rinda-patch.rb - About 1 day to fix

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

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

        Class DataLocation has 41 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class DataLocation < BasicLocation
              location_type :data
        
              KNOWN_ATTRS = [:need_caching, :real_appendable, :writable]
        
        
        Severity: Minor
        Found in lib/pione/location/data-location.rb - About 5 hrs to fix

          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
          Severity: Minor
          Found in lib/pione/rule-engine/update-criteria.rb - About 5 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 drb-patch.rb has 376 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module Pione
            module DRbPatch
              #
              # special protocol
              #
          Severity: Minor
          Found in lib/pione/patch/drb-patch.rb - About 5 hrs to fix

            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)
            
            
            Severity: Minor
            Found in lib/pione/command/pione-tuple-space-viewer.rb - About 4 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 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.
            Severity: Minor
            Found in lib/pione/pnml/pione-model.rb - About 4 hrs to fix

              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
              Severity: Minor
              Found in lib/pione/tuple-space/basic-tuple.rb - About 4 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_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|
              Severity: Minor
              Found in lib/pione/lang/feature-expr.rb - About 4 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 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.
              Severity: Minor
              Found in lib/pione/rule-engine/flow-handler.rb - About 3 hrs to fix

                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
                Severity: Minor
                Found in lib/pione/util/ftp-server.rb - About 3 hrs to fix

                  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
                  Severity: Minor
                  Found in lib/rootage/core.rb - About 3 hrs to fix

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

                      Method accept has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def accept
                              begin
                                # accept loop
                                while true
                                  soc = @socket.accept
                      Severity: Minor
                      Found in lib/pione/relay/relay-socket.rb - About 3 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 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
                      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 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
                      Severity: Minor
                      Found in lib/pione/util/cgi.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 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)
                      
                      
                      Severity: Minor
                      Found in lib/pione/pnml/input-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 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)
                      Severity: Minor
                      Found in lib/pione/command/spawner.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 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
                      Severity: Minor
                      Found in lib/pione/test-helper/parser-helper.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

                      Severity
                      Category
                      Status
                      Source
                      Language