applicationsonline/librarian

View on GitHub

Showing 25 of 27 total issues

Class Environment has 37 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Environment

    include Support::AbstractMethod

    attr_accessor :ui
Severity: Minor
Found in lib/librarian/environment.rb - About 4 hrs to fix

    Class Database has 34 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class Database
    
          class << self
            def library
              name.split("::").first.downcase
    Severity: Minor
    Found in lib/librarian/config/database.rb - About 4 hrs to fix

      Class ManifestSet has 25 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class ManifestSet
      
          class << self
            def shallow_strip(manifests, names)
              new(manifests).shallow_strip!(names).send(method_for(manifests))
      Severity: Minor
      Found in lib/librarian/manifest_set.rb - About 2 hrs to fix

        Class Implementation has 24 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class Implementation
        
              class MultiSource
                attr_accessor :sources
                def initialize(sources)
        Severity: Minor
        Found in lib/librarian/resolver/implementation.rb - About 2 hrs to fix

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

                def cache!
                  repository_cached? and return or repository_cached!
          
                  unless repository.git?
                    repository.path.rmtree if repository.path.exist?
          Severity: Minor
          Found in lib/librarian/source/git.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

          Class Cli has 23 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class Cli < Thor
          
              autoload :ManifestPresenter, "librarian/cli/manifest_presenter"
          
              include Thor::Actions
          Severity: Minor
          Found in lib/librarian/cli.rb - About 2 hrs to fix

            Class Repository has 22 methods (exceeds 20 allowed). Consider refactoring.
            Open

                  class Repository
            
                    class << self
                      def clone!(environment, path, repository_url)
                        path = Pathname.new(path)
            Severity: Minor
            Found in lib/librarian/source/git/repository.rb - About 2 hrs to fix

              Class SpecChangeSet has 22 methods (exceeds 20 allowed). Consider refactoring.
              Open

                class SpecChangeSet
              
                  attr_accessor :environment
                  private :environment=
                  attr_reader :spec, :lock
              Severity: Minor
              Found in lib/librarian/spec_change_set.rb - About 2 hrs to fix

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

                    def config(key = nil, value = nil)
                      if key
                        raise Error, "cannot set both value and delete" if value && options["delete"]
                        if options["delete"]
                          scope = config_scope(true)
                Severity: Minor
                Found in lib/librarian/cli.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 enforce_consistency! has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def enforce_consistency!(dependencies, manifests)
                      manifest_set = ManifestSet.new(manifests)
                      return if manifest_set.in_compliance_with?(dependencies)
                      return if manifest_set.consistent?
                
                
                Severity: Minor
                Found in lib/librarian/resolver.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 enforce_consistency! has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def enforce_consistency!(dependencies, manifests)
                      manifest_set = ManifestSet.new(manifests)
                      return if manifest_set.in_compliance_with?(dependencies)
                      return if manifest_set.consistent?
                
                
                Severity: Minor
                Found in lib/librarian/resolver.rb - About 1 hr to fix

                  Method logging_command has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def logging_command(command, options)
                            silent = options.delete(:silent)
                  
                            pwd = Dir.pwd
                  
                  
                  Severity: Minor
                  Found in lib/librarian/source/git/repository.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 logging_command has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def logging_command(command, options)
                            silent = options.delete(:silent)
                  
                            pwd = Dir.pwd
                  
                  
                  Severity: Minor
                  Found in lib/librarian/source/git/repository.rb - About 1 hr to fix

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

                          def extract_and_parse_sources(lines)
                            sources = []
                            while source_type_names.include?(lines.first)
                              source = {}
                              source_type_name = lines.shift
                    Severity: Minor
                    Found in lib/librarian/lockfile/parser.rb - About 1 hr to fix

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

                          def debug(string = nil, &block)
                            return unless ui
                      
                            if ui.respond_to?(:debug_line_numbers) && ui.debug_line_numbers
                              loc = caller.find{|l| !(l =~ /in `debug'$/)}
                      Severity: Minor
                      Found in lib/librarian/logger.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 recursive_resolve has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def recursive_resolve(state)
                              shift_resolved_enqueued_dependencies(state) or return
                              state.queue.empty? and return state.manifests
                      
                              state.dependencies << state.queue.shift
                      Severity: Minor
                      Found in lib/librarian/resolver/implementation.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 default_project_root_path has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def default_project_root_path
                              if root
                                root
                              else
                                path = underlying_pwd
                      Severity: Minor
                      Found in lib/librarian/config/database.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 extract_and_parse_sources has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def extract_and_parse_sources(lines)
                              sources = []
                              while source_type_names.include?(lines.first)
                                source = {}
                                source_type_name = lines.shift
                      Severity: Minor
                      Found in lib/librarian/lockfile/parser.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 each_cyclic_strongly_connected_component_set has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def each_cyclic_strongly_connected_component_set(graph)
                              return enum_for(__method__, graph) unless block_given?
                              GraphHash.from(graph).each_strongly_connected_component do |scc|
                                if scc.size == 1
                                  n = scc.first
                      Severity: Minor
                      Found in lib/librarian/algorithms.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 config_scope has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def config_scope(exclusive)
                            g, l = "global", "local"
                            if exclusive
                              options[g] ^ options[l] or raise Error, "must set either #{g} or #{l}"
                            else
                      Severity: Minor
                      Found in lib/librarian/cli.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

                      Severity
                      Category
                      Status
                      Source
                      Language