colinsurprenant/redstorm

View on GitHub

Showing 12 of 33 total issues

Class Spout has 37 methods (exceeds 20 allowed). Consider refactoring.
Open

    class Spout
      attr_reader :config, :context, :collector

      def self.java_proxy; "Java::RedstormStormJruby::JRubySpout"; end

Severity: Minor
Found in lib/red_storm/dsl/spout.rb - About 4 hrs to fix

    Class Bolt has 28 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class Bolt
          attr_reader :collector, :context, :config
    
          def self.java_proxy; "Java::RedstormStormJruby::JRubyBolt"; end
    
    
    Severity: Minor
    Found in lib/red_storm/dsl/bolt.rb - About 3 hrs to fix

      Method build_topology has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def build_topology(local_drpc)
            spout = FixedBatchSpout.new(
              Fields.new("sentence"), 3,
              Values.new("the cow jumped over the moon"),
              Values.new("the man went to the store and bought some candy"),
      Severity: Major
      Found in examples/trident/word_count_topology.rb - About 2 hrs to fix

        Method run has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def self.run(args)
              if args.size > 0
                if args[0] == "version"
                  puts("RedStorm v#{VERSION}")
                  exit
        Severity: Minor
        Found in lib/red_storm/application.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 execute has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

              def execute(tuple)
                output = on_receive(tuple)
                if output && self.class.emit?
                  values_list = !output.is_a?(Array) ? [[output]] : !output.first.is_a?(Array) ? [output] : output
                  values_list.each{|values| self.class.anchor? ? anchored_emit(tuple, *values) : unanchored_emit(*values)}
        Severity: Minor
        Found in lib/red_storm/dsl/bolt.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 resolve_ids! has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

              def self.resolve_ids!(components)
                # verify duplicate implicit ids
                ids = components.map(&:id)
                components.reverse.each do |component|
                  raise("duplicate id in #{component.clazz.name} on id=#{component.id}") if ids.select{|id| id == component.id}.size > 1
        Severity: Minor
        Found in lib/red_storm/dsl/topology.rb - About 55 mins 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

        Function run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def run(self):
                global MODE
                MODE = Spout
                conf, context = initComponent()
                self.initialize(conf, context)
        Severity: Minor
        Found in examples/shell/resources/storm.py - About 45 mins 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 next_tuple has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

              def next_tuple
                output = on_send
        
                if self.class.emit?
                  if output
        Severity: Minor
        Found in lib/red_storm/dsl/spout.rb - About 45 mins 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

        Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, id, component, stream, task, values):
        Severity: Minor
        Found in examples/shell/resources/storm.py - About 35 mins to fix

          Method input_bolt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

                def self.input_bolt(bolt_class, *args, &bolt_block)
                  set_topology_class!
                  options = args.last.is_a?(Hash) ? args.pop : {}
                  contructor_args = !args.empty? ? args.pop : []
                  bolt_options = {:id => self.underscore(bolt_class), :parallelism => DEFAULT_BOLT_PARALLELISM}.merge(options)
          Severity: Minor
          Found in lib/red_storm/dsl/drpc_topology.rb - About 25 mins 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 bolt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

                def self.bolt(bolt_class, *args, &bolt_block)
                  set_topology_class!
                  options = args.last.is_a?(Hash) ? args.pop : {}
                  contructor_args = !args.empty? ? args.pop : []
                  bolt_options = {:id => self.underscore(bolt_class), :parallelism => DEFAULT_BOLT_PARALLELISM}.merge(options)
          Severity: Minor
          Found in lib/red_storm/dsl/topology.rb - About 25 mins 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 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            def self.main(args)
              unless args.size > 1
                puts("Usage: redstorm local|cluster topology_class_file_name")
                exit(1)
              end
          Severity: Minor
          Found in lib/red_storm/topology_launcher.rb - About 25 mins 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