Showing 268 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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

          def self.rewrite(net, subjects, env)
            place, transition, arc = subjects
    
            # remove subjects from the net
            net.places.delete(place)
    Severity: Major
    Found in lib/pione/pnml/output-reduction.rb and 1 other location - About 1 hr to fix
    lib/pione/pnml/input-reduction.rb on lines 57..74

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 68.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

          def self.rewrite(net, subjects, env)
            transition, place, arc = subjects
    
            # remove subjects from the net
            net.places.delete(place)
    Severity: Major
    Found in lib/pione/pnml/input-reduction.rb and 1 other location - About 1 hr to fix
    lib/pione/pnml/output-reduction.rb on lines 69..86

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 68.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

            define(:notification_receivers) do |item|
              item.type = :string
              item.long = "--notification-receiver"
              item.arg  = "URI"
              item.desc = "Receiver address that notifications are received at"
      Severity: Major
      Found in lib/pione/command/option.rb and 1 other location - About 1 hr to fix
      lib/pione/command/option.rb on lines 160..179

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 64.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

            define(:notification_targets) do |item|
              item.type = :string
              item.long = '--notification-target'
              item.arg  = 'URI'
              item.desc = 'Target address that notifications are sent to'
      Severity: Major
      Found in lib/pione/command/option.rb and 1 other location - About 1 hr to fix
      lib/pione/command/option.rb on lines 184..205

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 64.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          module BooleanValue
            class << self
              # Return boolean value of the object.
              #
              # @param val [Object]
      Severity: Major
      Found in lib/pione/util/boolean-value.rb and 1 other location - About 1 hr to fix
      lib/rootage/normalizer.rb on lines 130..184

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 62.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        module BooleanValue
          class << self
            # Return boolean value of the object.
            #
            # @param val [Object]
      Severity: Major
      Found in lib/rootage/normalizer.rb and 1 other location - About 1 hr to fix
      lib/pione/util/boolean-value.rb on lines 3..57

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 62.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      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

        Severity
        Category
        Status
        Source
        Language