WebBlocks/WebBlocks

View on GitHub

Showing 17 of 23 total issues

Method prepare_blocks! has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

        def prepare_blocks!

          log.scope 'INIT' do |log|

            begin
Severity: Minor
Found in lib/web_blocks/thor/base/prepare_blocks.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 handle has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

      def handle name, attributes = {}, &block

        this = self

        attributes[:path] = name unless attributes.has_key? :path
Severity: Minor
Found in lib/web_blocks/facade/recursive_file_names_block.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 all has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def all

        # TODO: refactor this file so it's not a run-on routine

        prepare_blocks!
Severity: Major
Found in lib/web_blocks/thor/watch/all.rb - About 2 hrs to fix

    Method handle has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

          def handle name, attributes = {}, &block
    
            this = self
    
            attributes[:path] = name unless attributes.has_key? :path
    Severity: Minor
    Found in lib/web_blocks/facade/directory_name_block.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 resolved_path has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

          def resolved_path
    
            parents_except_root = parents
    
            # we're not going to use the root's path for determining if there's an implicit path
    Severity: Minor
    Found in lib/web_blocks/structure/block_core.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 all has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

          def all
    
            # TODO: refactor this file so it's not a run-on routine
    
            prepare_blocks!
    Severity: Minor
    Found in lib/web_blocks/thor/watch/all.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 parse_value has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

                def parse_value value
                  if @value.is_a?(::Array) or @value.is_a?(::Hash)
                    value.size > 0 ? value : nil
                  elsif value.is_a?(::String)
                    "\"#{value}\""
    Severity: Minor
    Found in lib/web_blocks/thor/inspect/blocks.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 adjacency_list has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

          def adjacency_list
    
            file_dependencies = {}
    
            files = required_files
    Severity: Minor
    Found in lib/web_blocks/structure/framework.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 10 (exceeds 5 allowed). Consider refactoring.
    Open

            def execute!
    
              super do
    
                File.open task.base_path + product_path, 'w' do |product|
    Severity: Minor
    Found in lib/web_blocks/strategy/optimize/js.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 10 (exceeds 5 allowed). Consider refactoring.
    Open

            def execute!
    
              super do
    
                File.open task.base_path + product_path, 'w' do |product|
    Severity: Minor
    Found in lib/web_blocks/strategy/optimize/css.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 handle has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def handle name, attributes = {}, &block
    
            this = self
    
            attributes[:path] = name unless attributes.has_key? :path
    Severity: Minor
    Found in lib/web_blocks/facade/directory_name_block.rb - About 1 hr to fix

      Method handle has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def handle name, attributes = {}, &block
      
              this = self
      
              attributes[:path] = name unless attributes.has_key? :path
      Severity: Minor
      Found in lib/web_blocks/facade/recursive_file_names_block.rb - About 1 hr to fix

        Method handle has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

              def handle name, attributes = {}, &block
        
                this = self
        
                block_was_given = block_given?
        Severity: Minor
        Found in lib/web_blocks/facade/file_name_block.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

        Method load_bower_registry! has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

              def load_bower_registry! log
        
                log.scope 'Block' do |log|
                  log.debug do
                    task = self
        Severity: Minor
        Found in lib/web_blocks/thor/base/prepare_blocks.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

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

              def scoped_progname progname = nil
                if scopename
                  progname ? "#{scopename} - #{progname}" : scopename
                else
                  progname ? progname : nil
        Severity: Minor
        Found in lib/web_blocks/support/scoped_logger.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 include_routes_from_command_line! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

              def include_routes_from_command_line! log
        
                route = []
        
                self.options.include.each do |segment|
        Severity: Minor
        Found in lib/web_blocks/thor/base/prepare_blocks.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 attributes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

                  def attributes name = nil
                    if name
                      @@attributes.has_key?(name) ? @@attributes[name] : {}
                    else
                      @@attributes ||= {}
        Severity: Minor
        Found in lib/web_blocks/support/attributes/class/container.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