wbailey/claws

View on GitHub

Showing 9 of 9 total issues

Method exec has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def self.exec
        h = {
          'capistrano' => {
            'home' => nil,
          },
Severity: Major
Found in lib/claws/command/initialize.rb - About 2 hrs to fix

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

          def run
            table :border => true do
              row :header => true do
                column 'Choice', :width => 6, :color => 'blue', :bold => true, :align => 'right'
    
    
    Severity: Minor
    Found in lib/claws/report/ec2.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 exec has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

          def self.exec(options)
            begin
              config = Claws::Configuration.new( options.config_file )
            rescue Claws::ConfigurationError => e
              puts e.message
    Severity: Minor
    Found in lib/claws/command/ec2.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 parse has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def self.parse
          options = OpenStruct.new(
            {
              :config_file => nil,
              :connect => true,
    Severity: Minor
    Found in lib/claws/options.rb - About 1 hr to fix

      Method exec has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def self.exec(options)
              begin
                config = Claws::Configuration.new( options.config_file )
              rescue Claws::ConfigurationError => e
                puts e.message
      Severity: Minor
      Found in lib/claws/command/ec2.rb - About 1 hr to fix

        Method run has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def run
                table :border => true do
                  row :header => true do
                    column 'Choice', :width => 6, :color => 'blue', :bold => true, :align => 'right'
        
        
        Severity: Minor
        Found in lib/claws/report/ec2.rb - About 1 hr to fix

          Method tags has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def tags
                  @ec2.try(:tags) ? @ec2.tags.select {|k,v| [k,v] unless k.downcase == 'name'}.map{|k,v| "#{k}: #{v}"}.join(', ') : 'N/A'
                end
          Severity: Minor
          Found in lib/claws/presenter/ec2.rb - About 35 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 get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def get(filters = {})
                  collection = []
          
                  AWS::EC2.new.regions.each do |region|
                    if config.ec2.regions
          Severity: Minor
          Found in lib/claws/collection/ec2.rb - About 35 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 method_missing has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

                def method_missing(meth)
                  case meth
                  when :name
                    @ec2.send(:tags)['Name'] || 'N/A'
                  when @ec2.try(:tags) && @ec2.tags.has_key?(meth)
          Severity: Minor
          Found in lib/claws/presenter/ec2.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