cesarferreira/gito

View on GitHub

Showing 5 of 5 total issues

Method create_options_parser has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def create_options_parser(args)
    args.options do |opts|
      opts.banner = 'Usage: gito GIT_URL [OPTIONS]'
      opts.separator ''
      opts.separator 'Options'
Severity: Minor
Found in lib/gito.rb - About 1 hr to fix

    Method call has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def call
        if @options[:setting_up]
          if @options[:editor].nil?
              puts 'New new editor can\'t be empty'.red
            else
    Severity: Minor
    Found in lib/gito.rb - About 1 hr to fix

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

        def call
          if @options[:setting_up]
            if @options[:editor].nil?
                puts 'New new editor can\'t be empty'.red
              else
      Severity: Minor
      Found in lib/gito.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 sanitize_url has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        def sanitize_url(url)
          url = url.split('?').first
          url.chop! if url.end_with? '/'
      
          is_valid_url = url =~ /\A#{URI::regexp(['http', 'https'])}\z/ || url.include?('git@')
      Severity: Minor
      Found in lib/gito/project.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 clone has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        def clone(is_temp_folder=false, shell_copy=true)
          url = retrieve_cloneable_url
      
          unless is_temp_folder
            prefix = Dir.pwd + '/'
      Severity: Minor
      Found in lib/gito/project.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