Showing 58 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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        module Inch
          module Language
            module Elixir
              # This is the base class for code object proxies.
              # Code object proxies are via an attributes Hash and provide all methods
        Severity: Major
        Found in lib/inch/language/elixir/code_object/base.rb and 1 other location - About 6 hrs to fix
        lib/inch/language/javascript/code_object/base.rb on lines 3..193

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 198.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        module Inch
          module Language
            module JavaScript
              # This is the base class for code object proxies.
              # Code object proxies are via an attributes Hash and provide all methods
        Severity: Major
        Found in lib/inch/language/javascript/code_object/base.rb and 1 other location - About 6 hrs to fix
        lib/inch/language/elixir/code_object/base.rb on lines 3..193

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 198.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  module Inch
                    module Language
                      module Elixir
                        module CodeObject
                          # Proxy class for functions
                  Severity: Major
                  Found in lib/inch/language/elixir/code_object/function_object.rb and 1 other location - About 2 hrs to fix
                  lib/inch/language/javascript/code_object/function_object.rb on lines 3..70

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 102.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  module Inch
                    module Language
                      module JavaScript
                        module CodeObject
                          # Proxy class for functions
                  Severity: Major
                  Found in lib/inch/language/javascript/code_object/function_object.rb and 1 other location - About 2 hrs to fix
                  lib/inch/language/elixir/code_object/function_object.rb on lines 3..70

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 102.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                    module Language
                      module JavaScript
                        module Evaluation
                          module Role
                            module Function
                  Severity: Major
                  Found in lib/inch/language/javascript/roles/function.rb and 2 other locations - About 2 hrs to fix
                  lib/inch/language/elixir/roles/function.rb on lines 2..105
                  lib/inch/language/ruby/roles/method.rb on lines 2..105

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 94.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                    module Language
                      module Elixir
                        module Evaluation
                          module Role
                            module Function
                  Severity: Major
                  Found in lib/inch/language/elixir/roles/function.rb and 2 other locations - About 2 hrs to fix
                  lib/inch/language/javascript/roles/function.rb on lines 2..105
                  lib/inch/language/ruby/roles/method.rb on lines 2..105

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 94.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                    module Language
                      module Ruby
                        module Evaluation
                          module Role
                            module Method
                  Severity: Major
                  Found in lib/inch/language/ruby/roles/method.rb and 2 other locations - About 2 hrs to fix
                  lib/inch/language/elixir/roles/function.rb on lines 2..105
                  lib/inch/language/javascript/roles/function.rb on lines 2..105

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 94.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  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

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                      module Language
                        module JavaScript
                          module CodeObject
                            # Proxy class for method parameters
                            class FunctionParameterObject
                    lib/inch/language/ruby/code_object/method_parameter_object.rb on lines 2..58

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 72.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                      module Language
                        module Ruby
                          module CodeObject
                            # Proxy class for method parameters
                            class MethodParameterObject
                    lib/inch/language/javascript/code_object/function_parameter_object.rb on lines 2..58

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 72.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    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

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                      module Language
                        module Ruby
                          module Evaluation
                            module Role
                              # Roles assigned to constants
                    Severity: Major
                    Found in lib/inch/language/ruby/roles/constant.rb and 1 other location - About 1 hr to fix
                    lib/inch/language/ruby/roles/class_variable.rb on lines 2..45

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 64.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language