Showing 23 of 58 total issues

Class Base has 48 methods (exceeds 20 allowed). Consider refactoring.
Open

            class Base
              # @return [String] the codebase's directory
              attr_accessor :base_dir

              # @param hash [Hash] hash returned via JSON interface
Severity: Minor
Found in lib/inch/language/javascript/provider/jsdoc/object/base.rb - About 6 hrs to fix

    Class Base has 45 methods (exceeds 20 allowed). Consider refactoring.
    Open

                class Base
                  # @param hash [Hash] hash returned via JSON interface
                  def initialize(hash)
                    @hash = hash
                  end
    Severity: Minor
    Found in lib/inch/language/elixir/provider/reader_v2/object/base.rb - About 6 hrs to fix

      Class Base has 45 methods (exceeds 20 allowed). Consider refactoring.
      Open

                  class Base
                    # @param hash [Hash] hash returned via JSON interface
                    def initialize(hash)
                      @hash = hash
                    end
      Severity: Minor
      Found in lib/inch/language/elixir/provider/reader/object/base.rb - About 6 hrs to fix

        Class Base has 43 methods (exceeds 20 allowed). Consider refactoring.
        Open

                    class Base
                      extend Forwardable
                      include YARD::NodocHelper
        
                      # @return [YARD::CodeObjects::Base] the actual (YARD) code object
        Severity: Minor
        Found in lib/inch/language/ruby/provider/yard/object/base.rb - About 5 hrs to fix

          Class Base has 36 methods (exceeds 20 allowed). Consider refactoring.
          Open

                  class Base < Inch::CodeObject::Proxy
                    def language
                      :ruby
                    end
          
          
          Severity: Minor
          Found in lib/inch/language/ruby/code_object/base.rb - About 4 hrs to fix

            Class Base has 35 methods (exceeds 20 allowed). Consider refactoring.
            Open

                    class Base < Inch::CodeObject::Proxy
                      def language
                        :elixir
                      end
            
            
            Severity: Minor
            Found in lib/inch/language/elixir/code_object/base.rb - About 4 hrs to fix

              Class Base has 35 methods (exceeds 20 allowed). Consider refactoring.
              Open

                      class Base < Inch::CodeObject::Proxy
                        def language
                          :javascript
                        end
              
              
              Severity: Minor
              Found in lib/inch/language/javascript/code_object/base.rb - About 4 hrs to fix

                Class MethodObject has 27 methods (exceeds 20 allowed). Consider refactoring.
                Open

                            class MethodObject < Base
                              UNUSABLE_RETURN_VALUES = %w(nil nothing undefined void)
                
                              def aliases_fullnames
                                object.aliases.map(&:path)
                Severity: Minor
                Found in lib/inch/language/ruby/provider/yard/object/method_object.rb - About 3 hrs to fix

                  Class Docstring has 21 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                            class Docstring
                              def initialize(text)
                                @text = text.to_s
                              end
                  
                  
                  Severity: Minor
                  Found in lib/inch/language/ruby/provider/yard/docstring.rb - About 2 hrs to fix

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

                                def parse_code_examples
                                  code_examples = []
                                  example = nil
                                  @text.lines.each do |line|
                                    if line =~ /^\s*+$/
                    Severity: Minor
                    Found in lib/inch/language/ruby/provider/yard/docstring.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 implicit_nodoc_comment? has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                                def implicit_nodoc_comment?
                                  return false if explicit_doc_comment?
                    
                                  if parent
                                    return false if parent.explicit_doc_comment?
                    Severity: Minor
                    Found in lib/inch/language/ruby/provider/yard/nodoc_helper.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 list_options has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                              def list_options(opts)
                                opts.separator ''
                                opts.separator 'List options:'
                    
                                opts.on('--all', 'Show all objects in the output') do
                    Severity: Minor
                    Found in lib/inch/cli/command/options/base_list.rb - About 1 hr to fix

                      Method relevant_base_roles has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                def relevant_base_roles
                                  {
                                    Role::Object::InRoot => nil,
                                    Role::Object::Public => nil,
                                    Role::Object::Protected => nil,
                      Severity: Minor
                      Found in lib/inch/language/ruby/evaluation/base.rb - About 1 hr to fix

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

                              def get_term_columns(default = 80)
                                str = `stty size 2>&1`
                                if str =~ /Invalid argument/
                                  default
                                else
                        Severity: Minor
                        Found in lib/inch/cli.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 to_hash has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def self.to_hash(o)
                                attributes = {}
                                OBJECT_ATTRIBUTES.each do |name|
                                  next unless o.respond_to?(name)
                                  attributes[name] = o.public_send(name)
                        Severity: Minor
                        Found in lib/inch/code_object/converter.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 name_from_tuple has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                                        def name_from_tuple(a, _, b)
                                          if b.nil? || b == 'Elixir'
                                            a
                                          else
                                            if a == '\\\\'
                        Severity: Minor
                        Found in lib/inch/language/elixir/provider/reader/object/function_object.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

                        Method name_from_tuple has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                                        def name_from_tuple(a, _, b)
                                          if b.nil? || b == 'Elixir'
                                            a
                                          else
                                            if a == '\\\\'
                        Severity: Minor
                        Found in lib/inch/language/elixir/provider/reader_v2/object/function_object.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

                        Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                  def initialize(options, relevant_objects, objects_to_display,
                                                 grade_lists, files)
                        Severity: Minor
                        Found in lib/inch/cli/command/output/suggest.rb - About 35 mins to fix

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

                                    def print_roles_info(o)
                                      if o.roles.empty?
                                        echo 'No roles assigned.'.color(:dark)
                                      else
                                        o.roles.each do |role|
                          Severity: Minor
                          Found in lib/inch/cli/command/output/show.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

                          Avoid too many return statements within this method.
                          Open

                                              return true
                          Severity: Major
                          Found in lib/inch/language/ruby/provider/yard/nodoc_helper.rb - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language