Undev/redmine_undev_git

View on GitHub

Showing 48 of 48 total issues

Method revisions_in_chunks has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

    def revisions_in_chunks(path, identifier_from, identifier_to, options = {}, &block)

      revision_regexp = %r{
            (?<h>[0-9a-f]{40});\s
            (?<ai>.*);\s
Severity: Minor
Found in lib/redmine/scm/adapters/undev_git_adapter.rb - About 1 day 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 entries has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    def entries(path, identifier = nil, options = {})
      path     ||= ''
      p        = scm_iconv(path_encoding, 'UTF-8', path)
      entries  = Entries.new
      cmd_args = %w{ls-tree -l}
Severity: Minor
Found in lib/redmine/scm/adapters/undev_git_adapter.rb - About 7 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

File undev_git_adapter.rb has 417 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require_dependency 'redmine/scm/adapters/git_adapter'
require_dependency 'redmine/scm/adapters/undev_git_revision'

module Redmine::Scm::Adapters
  class UndevGitAdapter < AbstractAdapter
Severity: Minor
Found in lib/redmine/scm/adapters/undev_git_adapter.rb - About 6 hrs to fix

    Class RemoteRepoFetch has 42 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class RemoteRepoFetch
        attr_reader :repo
    
        HookRequest = Struct.new(:issue, :hook, :repo_revision, :keyword, :branch) do
          def valid?
    Severity: Minor
    Found in lib/redmine_undev_git/services/remote_repo_fetch.rb - About 5 hrs to fix

      Method revisions has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

          def revisions(include_revs = nil, exclude_revs = nil, options = {})
      
            # :sha              %H
            # :author           %an %ae
            # :author_date      %ai
      Severity: Minor
      Found in lib/redmine_undev_git/services/git_adapter.rb - About 4 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 UndevGitAdapter has 29 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class UndevGitAdapter < AbstractAdapter
      
          include RedmineUndevGit::Includes::GitShell
      
          # Git executable name
      Severity: Minor
      Found in lib/redmine/scm/adapters/undev_git_adapter.rb - About 3 hrs to fix

        File remote_repo_fetch.rb has 311 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        module RedmineUndevGit::Services
          # fetch remote repository
          class RemoteRepoFetch
            attr_reader :repo
        
        
        Severity: Minor
        Found in lib/redmine_undev_git/services/remote_repo_fetch.rb - About 3 hrs to fix

          Method revisions_in_chunks has 71 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def revisions_in_chunks(path, identifier_from, identifier_to, options = {}, &block)
          
                revision_regexp = %r{
                      (?<h>[0-9a-f]{40});\s
                      (?<ai>.*);\s
          Severity: Major
          Found in lib/redmine/scm/adapters/undev_git_adapter.rb - About 2 hrs to fix

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

                  def parse_comment_for_issues(ref_keywords, fix_keywords)
                    ret = { ref_issues: [], fix_issues: {}, log_time: {} }
            
                    return ret if comments.blank?
            
            
            Severity: Minor
            Found in lib/redmine_undev_git/patches/changeset_patch.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 apply_hooks_for_merged_commits has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

              def apply_hooks_for_merged_commits(prev_branches, repo_branches)
                return unless initialization_done? || use_init_hooks?
            
                all_hooks     = all_applicable_hooks.find_all { |b| !b.any_branch? }
                hook_branches = all_hooks.map(&:branches).flatten.uniq
            Severity: Minor
            Found in lib/redmine_undev_git/includes/repo_hooks.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 run_migration has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                  def run_migration
                    mappings.each_with_index do |m, i|
                      puts "#{i}/#{mappings.count} Processing #{m.old_repo}"
            
                      if m.new_repo.url.blank?
            Severity: Minor
            Found in lib/redmine_undev_git/services/migration.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 apply_hooks_to_issue_by_repo_revision has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                def apply_hooks_to_issue_by_repo_revision(issue_id, action, repo_revision)
            
                  issue = Issue.find_by_id(issue_id)
            
                  unless Policies::ApplyHooks.allowed?(repo_revision.committer, issue)
            Severity: Minor
            Found in lib/redmine_undev_git/services/remote_repo_fetch.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 run_migration has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def run_migration
                    mappings.each_with_index do |m, i|
                      puts "#{i}/#{mappings.count} Processing #{m.old_repo}"
            
                      if m.new_repo.url.blank?
            Severity: Major
            Found in lib/redmine_undev_git/services/migration.rb - About 2 hrs to fix

              Method revisions has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def revisions(include_revs = nil, exclude_revs = nil, options = {})
              
                    # :sha              %H
                    # :author           %an %ae
                    # :author_date      %ai
              Severity: Major
              Found in lib/redmine_undev_git/services/git_adapter.rb - About 2 hrs to fix

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

                    def revisions(path, identifier_from, identifier_to, options = {}, &block)
                      if block_given?
                        raise 'Can' 't read chunks with reverse option' if options[:reverse]
                        revisions_in_chunks(path, identifier_from, identifier_to, options, &block)
                      else
                Severity: Minor
                Found in lib/redmine/scm/adapters/undev_git_adapter.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 revisions_for_git_cmd has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    def revisions_for_git_cmd(options = {})
                      revisions                      = []
                      identifier_from, identifier_to = options[:identifier_from], options[:identifier_to]
                      if identifier_from || identifier_to
                        revisions << ''
                Severity: Minor
                Found in lib/redmine/scm/adapters/undev_git_adapter.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 chunked_git_log has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    def chunked_git_log(path, options, &block)
                      skip = 0
                
                      revisions = revisions_for_git_cmd(options)
                
                
                Severity: Minor
                Found in lib/redmine/scm/adapters/undev_git_adapter.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 entries has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def entries(path, identifier = nil, options = {})
                      path     ||= ''
                      p        = scm_iconv(path_encoding, 'UTF-8', path)
                      entries  = Entries.new
                      cmd_args = %w{ls-tree -l}
                Severity: Minor
                Found in lib/redmine/scm/adapters/undev_git_adapter.rb - About 1 hr to fix

                  Method hook_column_value has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def hook_column_value(column_name, value)
                      case value.class.name
                        when 'Symbol'
                          l(value)
                        when 'String'
                  Severity: Minor
                  Found in app/helpers/hooks_helper.rb - About 1 hr to fix

                    Method chunked_git_log has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def chunked_git_log(path, options, &block)
                          skip = 0
                    
                          revisions = revisions_for_git_cmd(options)
                    
                    
                    Severity: Minor
                    Found in lib/redmine/scm/adapters/undev_git_adapter.rb - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language