aanand/git-up

View on GitHub

Showing 8 of 8 total issues

Class GitUp has 26 methods (exceeds 20 allowed). Consider refactoring.
Open

class GitUp
  def run(argv)
    @fetch = true
    
    process_args(argv)
Severity: Minor
Found in lib/git-up.rb - About 3 hrs to fix

    File git-up.rb has 276 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'colored'
    require 'grit'
    
    require 'git-up/version'
    
    
    Severity: Minor
    Found in lib/git-up.rb - About 2 hrs to fix

      Method process_args has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def process_args(argv)
          banner = <<BANNER
      Fetch and rebase all remotely-tracked branches.
      
          $ git up
      Severity: Minor
      Found in lib/git-up.rb - About 1 hr to fix

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

          def run(argv)
            @fetch = true
            
            process_args(argv)
        
        
        Severity: Minor
        Found in lib/git-up.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 rebase_all_branches has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

          def rebase_all_branches
            col_width = branches.map { |b| b.name.length }.max + 1
        
            branches.each do |branch|
              remote = remote_map[branch.name]
        Severity: Minor
        Found in lib/git-up.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 rebase_all_branches has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def rebase_all_branches
            col_width = branches.map { |b| b.name.length }.max + 1
        
            branches.each do |branch|
              remote = remote_map[branch.name]
        Severity: Minor
        Found in lib/git-up.rb - About 1 hr to fix

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

            def process_args(argv)
              banner = <<BANNER
          Fetch and rebase all remotely-tracked branches.
          
              $ git up
          Severity: Minor
          Found in lib/git-up.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 check_bundler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            def check_bundler
              return unless use_bundler?
          
              begin
                require 'bundler'
          Severity: Minor
          Found in lib/git-up.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