sh19910711/git-contest

View on GitHub

Showing 71 of 77 total issues

Avoid too many return statements within this method.
Open

          return "6"
Severity: Major
Found in lib/contest/driver/codeforces_driver.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

              return "delphi"
    Severity: Major
    Found in lib/contest/driver/common.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                return "D"
      Severity: Major
      Found in lib/contest/driver/aizu_online_judge_driver.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                  return "python3"
        Severity: Major
        Found in lib/contest/driver/common.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                    return "7"
          Severity: Major
          Found in lib/contest/driver/codeforces_driver.rb - About 30 mins to fix

            Method get_commit_message has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                  def get_commit_message status
                    if @options[:message].nil?
                      message = @config["submit_rules"]["message"] || DEFAULT_COMMIT_MESSAGE
                      message = message.gsub '${site}', get_site_name
                      message = message.gsub '${problem-id}', get_problem_id(options)
            Severity: Minor
            Found in lib/contest/driver/base.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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                  def run
                    p options
            
                    unless has_next_token?
                      puts "Missing argument <name>"
            Severity: Minor
            Found in lib/git/contest/command_line/sub_commands/start_command.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 init_global has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            def init_global
              $git_contest_home   = File.expand_path(ENV['GIT_CONTEST_HOME'] || File.join("~", ".git-contest"))
              $git_contest_config = File.expand_path(ENV['GIT_CONTEST_CONFIG'] || File.join($git_contest_home, "config.yml"))
              if Git.do_no_echo 'branch'
                $MASTER = Git.do 'config --get git.contest.branch.master'
            Severity: Minor
            Found in lib/git/contest/common.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 submit_ext has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                  def submit_ext
                    trigger 'start'
                    problem_id = @options[:problem_id]
            
                    if (@options[:contest_id])
            Severity: Minor
            Found in lib/contest/driver/kattis_driver.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 set_default_options has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                  def set_default_options
                    options[:edit] = true if options[:edit].nil?
                    options[:keep] = false if options[:keep].nil?
                    options[:rebase] = false if options[:rebase].nil?
                    options[:force_delete] = false if options[:force_delete].nil?
            Severity: Minor
            Found in lib/git/contest/command_line/sub_commands/finish_command.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 run_site_add has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                  def run_site_add
                    # git-contest-config site add
                    if tokens.length == 1
                      puts "# input site config (password will be hidden)"
            
            
            Severity: Minor
            Found in lib/git/contest/command_line/sub_commands/config_command.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