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 == ".."
Severity: Minor
Found in lib/pione/location/local-location.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 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|
Severity: Minor
Found in lib/pione/lang/feature-expr.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 accept has 46 lines of code (exceeds 25 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 1 hr to fix

    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]
    Severity: Minor
    Found in lib/pione/patch/drb-patch.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_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|
    Severity: Minor
    Found in lib/pione/pnml/label-extractor.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 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
    Severity: Minor
    Found in lib/pione/util/cgi.rb - About 1 hr to fix

      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|
      Severity: Minor
      Found in lib/pione/agent/basic-agent.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 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)}
      Severity: Minor
      Found in lib/pione/patch/rinda-patch.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 start_readline has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

            def start_readline
              buf = ""
              mark = ">"
      
              # start loop
      Severity: Minor
      Found in lib/pione/command/pione-lang-interactive.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 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
      
      
      Severity: Minor
      Found in lib/pione/util/cgi.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 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 = []
      Severity: Minor
      Found in lib/pione/lang/context.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 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|
      Severity: Minor
      Found in lib/pione/lang/feature-expr.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 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
      
      
      Severity: Minor
      Found in lib/pione/relay/relay-socket.rb - About 1 hr to fix

        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
        Severity: Minor
        Found in lib/pione/log/system-log.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 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
        Severity: Minor
        Found in lib/pione/patch/drb-patch.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 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
        Severity: Minor
        Found in lib/pione/notification/address.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 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)
        Severity: Minor
        Found in lib/pione/pnml/pione-model.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 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)
        
        
        Severity: Minor
        Found in lib/pione/pnml/input-merge-complement.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_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
        Severity: Minor
        Found in lib/pione/package/package-scanner.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 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)
        Severity: Minor
        Found in lib/pione/lang/declaration.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