keepcosmos/terjira

View on GitHub

Showing 14 of 92 total issues

Method issue_detail_template has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def issue_detail_template
      %{<%= bold(issue.key) + ' in ' + issue.project.name %>

      <%= bold(issue.summary) %>

Severity: Minor
Found in lib/terjira/presenters/issue_presenter.rb - About 1 hr to fix

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

        def purge_dir(dir)
          Dir.foreach(dir) do |f|
            next if f =~ /^\.\.?$/
            path = File.join(dir, f)
            if File.directory?(path)
    Severity: Minor
    Found in lib/terjira/utils/file_cache.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 suggest_related_value_options has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def suggest_related_value_options(opts = {})
          if opts[:issuetype]
            if opts[:issuetype].key_value.casecmp('epic').zero?
              # Suggest epic name
              epic_name_field = Client::Field.epic_name
    Severity: Minor
    Found in lib/terjira/option_supportable.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 suggest_options has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def suggest_options(opts = {})
          origin = options.dup
          self.with_editor = origin.delete(:editor)
    
          if opts[:required].is_a? Array
    Severity: Minor
    Found in lib/terjira/option_supportable.rb - About 1 hr to fix

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

          def select_issue_status
            fetch(:status) do
              statuses = fetch(:statuses) do
                project = if issue = get(:issue)
                            if issue.respond_to?(:project)
      Severity: Minor
      Found in lib/terjira/option_support/option_selector.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 colorize_priority has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def colorize_priority(priority, opts = {})
            return '' unless priority.respond_to? :name
            name = priority.name
            infos = if name =~ /high|major|critic/i
                      [:red, '⬆']
      Severity: Minor
      Found in lib/terjira/presenters/issue_presenter.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 option_select_prompt has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def option_select_prompt
            return @_option_select_prompt if @_option_select_prompt
            @_option_select_prompt = TTY::Prompt.new(help_color: :cyan)
            @_option_select_prompt.on(:keypress) do |event|
              # emacs key binding
      Severity: Minor
      Found in lib/terjira/option_support/option_selector.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 insert_new_line has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def insert_new_line(str, length)
            str.split(/\r\n|\n/).map do |line|
              line.strip!
              if line.display_width < 1
                line
      Severity: Minor
      Found in lib/terjira/presenters/common_presenter.rb - About 25 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 suggest_options has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def suggest_options(opts = {})
            origin = options.dup
            self.with_editor = origin.delete(:editor)
      
            if opts[:required].is_a? Array
      Severity: Minor
      Found in lib/terjira/option_supportable.rb - About 25 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 issue_estimate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def issue_estimate(issue)
            field = Client::Field.story_points
            story_points = issue.try(field.key) if field.respond_to? :key
            return ['Story Points', story_points] if story_points
      
      
      Severity: Minor
      Found in lib/terjira/presenters/issue_presenter.rb - About 25 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 select_assignee has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def select_assignee
            fetch(:assignee) do
              users = fetch(:users) do
                if issue = get(:issue)
                  Client::User.assignables_by_issue(issue)
      Severity: Minor
      Found in lib/terjira/option_support/option_selector.rb - About 25 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 render_projects_summary has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def render_projects_summary(projects)
            return render('Nothing.') if projects.blank?
            head = %w(KEY NAME TYPE).map do |v|
              { value: v, alignment: :center }
            end
      Severity: Minor
      Found in lib/terjira/presenters/project_presenter.rb - About 25 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 build_auth_options_by_tty has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def build_auth_options_by_tty(options = {})
              puts 'Login will be required...'
              prompt = TTY::Prompt.new
      
              result = prompt.collect do
      Severity: Minor
      Found in lib/terjira/client/auth_option_builder.rb - About 25 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 colorize_issue_stastus has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def colorize_issue_stastus(status)
            category = status.statusCategory['name'] rescue nil
            category ||= status.name
            title = "#{status.name}"
      
      
      Severity: Minor
      Found in lib/terjira/presenters/issue_presenter.rb - About 25 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