rharriso/bower-rails

View on GitHub

Showing 7 of 7 total issues

Class Dsl has 32 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Dsl

    DEFAULT_DEPENDENCY_GROUP = :dependencies

    def self.evalute(root_path, filename)
Severity: Minor
Found in lib/bower-rails/dsl.rb - About 4 hrs to fix

    Method remove_extra_files has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        def remove_extra_files
          puts "\nAttempting to remove all but main files as specified by bower\n"
    
          Dir["#{components_directory}/*"].each do |component_dir|
            component_name = component_dir.split('/').last
    Severity: Minor
    Found in lib/bower-rails/performer.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 perform_command has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def perform_command(remove_components = true, &block)
          # Load in bower json file
          txt  = File.read(File.join(root_path, "bower.json"))
          json = JSON.parse(txt)
    
    
    Severity: Minor
    Found in lib/bower-rails/performer.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 asset has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def asset(name, *args, &block)
          @asset_name = name
          group = @current_group || default_group
          options = Hash === args.last ? args.pop.dup : {}
    
    
    Severity: Minor
    Found in lib/bower-rails/dsl.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 perform_command has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def perform_command(remove_components = true, &block)
          # Load in bower json file
          txt  = File.read(File.join(root_path, "bower.json"))
          json = JSON.parse(txt)
    
    
    Severity: Minor
    Found in lib/bower-rails/performer.rb - About 1 hr to fix

      Method perform has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def perform(remove_components = true, &block)
            npm_path = File.join(root_path, 'node_modules', '.bin')
            bower = find_command('bower', [npm_path])
      
            if bower.nil?
      Severity: Minor
      Found in lib/bower-rails/performer.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_command has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def find_command(cmd, paths = [])
            exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
            paths += ENV['PATH'].split(File::PATH_SEPARATOR)
            paths.each do |path|
              exts.each do |ext|
      Severity: Minor
      Found in lib/bower-rails/performer.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