Resolve rubocop failures on master
Latest test:rubocop
job on master shows ...
17 files inspected, 261 offenses detected
Accompanied with resolving this MR should be a removal of allow_failure: true
from .gitlab/ci/quarantine-report.gitlab-ci.yml
Show offenses
Warning: unrecognized cop RSpec/ExampleLength found in .rubocop.yml Warning: unrecognized cop RSpec/MultipleExpectations found in .rubocop.yml Inspecting 17 files CCWCCWWWCCW.C.WCC Offenses: Gemfile:10:1: C: Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem jsonlint should appear before terminal-table. gem 'jsonlint' ^^^^^^^^^^^^^^ bin/failed_review_app_deploys_report:23:81: C: Metrics/LineLength: Line is too long. [86/80] opts.on('-t', '--token ACCESS_TOKEN', String, 'A valid access token') do |value| ^^^^^^ bin/failed_review_app_deploys_report:27:81: C: Metrics/LineLength: Line is too long. [82/80] opts.on('--hours HOURS', Integer, 'Number of hours to look back') do |value| ^^ bin/failed_review_app_deploys_report:57:81: C: Metrics/LineLength: Line is too long. [86/80] client.jobs(GITLAB_PROJECT, scope: 'failed', per_page: 100).auto_paginate do |job| ^^^^^^ bin/failed_review_app_deploys_report:70:81: C: Metrics/LineLength: Line is too long. [111/80] @client ||= Gitlab.client(endpoint: COM_GITLAB_API, private_token: TokenFinder.find_token!(@options.token)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/failed_review_app_deploys_report:82:4: C: Style/SpecialGlobalVars: Prefer $PROGRAM_NAME over $0. if $0 == __FILE__ ^^ bin/compare_pipelines_jobs:20:81: C: Metrics/LineLength: Line is too long. [108/80] opts.banner = "Usage: #{__FILE__} [options] before_pipeline_url [after_pipeline_url|after_mr_url]\n\n" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/compare_pipelines_jobs:22:81: C: Metrics/LineLength: Line is too long. [85/80] opts.on('-t', '--token ACESS_TOKEN', String, 'A valid access token') do |value| ^^^^^ bin/compare_pipelines_jobs:41:20: C: Style/RedundantFreeze: Do not freeze immutable objects, as freezing them has no effect. COM_GITLAB_API = 'https://gitlab.com/api/v4'.freeze ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/compare_pipelines_jobs:42:20: C: Style/RedundantFreeze: Do not freeze immutable objects, as freezing them has no effect. DEV_GITLAB_API = 'https://dev.gitlab.org/api/v4'.freeze ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/compare_pipelines_jobs:43:31: C: Style/MutableConstant: Freeze mutable objects assigned to constants. MERGE_REQUEST_URL_PATTERN = %r{ ... ^^^ bin/compare_pipelines_jobs:50:26: C: Style/MutableConstant: Freeze mutable objects assigned to constants. PIPELINE_URL_PATTERN = %r{ ... ^^^ bin/compare_pipelines_jobs:61:81: C: Metrics/LineLength: Line is too long. [92/80] @after_params = after_pipeline_url(after_pipeline_or_mr_url).match(PIPELINE_URL_PATTERN) ^^^^^^^^^^^^ bin/compare_pipelines_jobs:75:81: C: Metrics/LineLength: Line is too long. [87/80] attr_reader :options, :before_params, :after_params, :token, :com_client, :dev_client ^^^^^^^ bin/compare_pipelines_jobs:77:3: W: Lint/DuplicateMethods: Method ComparePipelinesJobs#com_client is defined at both bin/compare_pipelines_jobs:75 and bin/compare_pipelines_jobs:77. def com_client ^^^^^^^^^^^^^^ bin/compare_pipelines_jobs:78:81: C: Metrics/LineLength: Line is too long. [114/80] @com_client ||= Gitlab.client(endpoint: COM_GITLAB_API, private_token: TokenFinder.find_token!(options.token)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/compare_pipelines_jobs:81:3: W: Lint/DuplicateMethods: Method ComparePipelinesJobs#dev_client is defined at both bin/compare_pipelines_jobs:75 and bin/compare_pipelines_jobs:81. def dev_client ^^^^^^^^^^^^^^ bin/compare_pipelines_jobs:82:81: C: Metrics/LineLength: Line is too long. [129/80] @dev_client ||= Gitlab.client(endpoint: DEV_GITLAB_API, private_token: TokenFinder.find_token!(options.token, suffix: 'dev')) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/compare_pipelines_jobs:100:81: C: Metrics/LineLength: Line is too long. [134/80] latest_pipeline = gitlab_client(mr_params[:host]).merge_request_pipelines(mr_params[:project], mr_params[:merge_request_id]).first ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/compare_pipelines_jobs:101:81: C: Metrics/LineLength: Line is too long. [99/80] raise "No pipeline found for merge request #{after_pipeline_or_mr_url}!" unless latest_pipeline ^^^^^^^^^^^^^^^^^^^ bin/compare_pipelines_jobs:108:81: C: Metrics/LineLength: Line is too long. [126/80] gitlab_client(params[:host]).pipeline_jobs(params[:project], params[:pipeline_id], per_page: 100).auto_paginate do |job| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/compare_pipelines_jobs:115:81: C: Metrics/LineLength: Line is too long. [88/80] gitlab_client(params[:host]).pipeline(params[:project], params[:pipeline_id]).status ^^^^^^^^ bin/compare_pipelines_jobs:119:4: C: Style/SpecialGlobalVars: Prefer $PROGRAM_NAME over $0. if $0 == __FILE__ ^^ bin/compare_pipelines_jobs:121:5: C: Style/StderrPuts: Use warn instead of $stderr.puts to allow such output to be disabled. $stderr.puts ComparePipelinesJobsOptionParser.parse(%w[--help]) ^^^^^^^^^^^^ bin/list_projects_of_group:26:81: C: Metrics/LineLength: Line is too long. [93/80] opts.on('-t', '--token ACESS_TOKEN', String, 'A valid admin access token') do |value| ^^^^^^^^^^^^^ bin/list_projects_of_group:34:81: C: Metrics/LineLength: Line is too long. [109/80] opts.on('-u', '--dry-run', 'Perform a dry run without actually toggling the feature flag') do |value| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/list_projects_of_group:51:16: C: Style/RedundantFreeze: Do not freeze immutable objects, as freezing them has no effect. GITLAB_API = 'https://gitlab.com/api/v4'.freeze ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/list_projects_of_group:77:81: C: Metrics/LineLength: Line is too long. [150/80] @projects = Gitlab.group_projects(group.id, include_subgroups: true, with_shared: false).auto_paginate.each_with_object([]) do |project, projects| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/list_projects_of_group:79:5: C: Style/MultilineBlockChain: Avoid multi-line chains of blocks. end.tap do |projects| ^^^^^^^ bin/list_projects_of_group:80:81: C: Metrics/LineLength: Line is too long. [85/80] puts "#{projects.size} projects were found under the #{group.full_path} group." ^^^^^ bin/list_projects_of_group:89:5: C: Style/StderrPuts: Use warn instead of $stderr.puts to allow such output to be disabled. $stderr.puts "Please provide a valid group_path with the `-g/--group` option!" ^^^^^^^^^^^^ bin/list_projects_of_group:89:18: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. $stderr.puts "Please provide a valid group_path with the `-g/--group` option!" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/list_projects_of_group:89:81: C: Metrics/LineLength: Line is too long. [82/80] $stderr.puts "Please provide a valid group_path with the `-g/--group` option!" ^^ bin/list_projects_of_group:94:4: C: Style/SpecialGlobalVars: Prefer $PROGRAM_NAME over $0. if $0 == __FILE__ ^^ bin/list_projects_of_group:99:8: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. puts "ID,Path,Name,Visibility,Archived,Created at,Last activity at,Forks count,Stars count" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/list_projects_of_group:99:81: C: Metrics/LineLength: Line is too long. [93/80] puts "ID,Path,Name,Visibility,Archived,Created at,Last activity at,Forks count,Stars count" ^^^^^^^^^^^^^ bin/list_projects_of_group:101:81: C: Metrics/LineLength: Line is too long. [208/80] puts "#{project.id},#{project.path_with_namespace},#{project.name},#{project.visibility},#{project.archived},#{project.created_at},#{project.last_activity_at},#{project.forks_count},#{project.star_count}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_timings:31:81: C: Metrics/LineLength: Line is too long. [85/80] opts.on('-t', '--token ACESS_TOKEN', String, 'A valid access token') do |value| ^^^^^ bin/pipeline_timings:35:81: C: Metrics/LineLength: Line is too long. [82/80] opts.on('-p', '--project PROJECT_PATH', String, 'A project path') do |value| ^^ bin/pipeline_timings:50:16: C: Style/RedundantFreeze: Do not freeze immutable objects, as freezing them has no effect. GITLAB_API = 'https://gitlab.com/api/v4'.freeze ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_timings:80:14: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. puts "Cutoff reached, exiting" ^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_timings:104:5: C: Style/StderrPuts: Use warn instead of $stderr.puts to allow such output to be disabled. $stderr.puts "Please provide a valid project_path with the `-p/--project` option!" ^^^^^^^^^^^^ bin/pipeline_timings:104:18: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. $stderr.puts "Please provide a valid project_path with the `-p/--project` option!" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_timings:104:81: C: Metrics/LineLength: Line is too long. [86/80] $stderr.puts "Please provide a valid project_path with the `-p/--project` option!" ^^^^^^ bin/pipeline_timings:109:4: C: Style/SpecialGlobalVars: Prefer $PROGRAM_NAME over $0. if $0 == __FILE__ ^^ bin/runner_timings:30:81: C: Metrics/LineLength: Line is too long. [85/80] opts.on('-t', '--token ACESS_TOKEN', String, 'A valid access token') do |value| ^^^^^ bin/runner_timings:34:81: C: Metrics/LineLength: Line is too long. [82/80] opts.on('-p', '--project PROJECT_PATH', String, 'A project path') do |value| ^^ bin/runner_timings:49:16: C: Style/RedundantFreeze: Do not freeze immutable objects, as freezing them has no effect. GITLAB_API = 'https://gitlab.com/api/v4'.freeze ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/runner_timings:64:3: C: Metrics/AbcSize: Assignment Branch Condition size for process is too high. [37.43/30] def process ... ^^^^^^^^^^^ bin/runner_timings:68:5: W: Lint/UselessAssignment: Useless assignment to variable - pipelines. pipelines = Gitlab ^^^^^^^^^ bin/runner_timings:80:14: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. warn "Cutoff reached, exiting" ^^^^^^^^^^^^^^^^^^^^^^^^^ bin/runner_timings:84:81: C: Metrics/LineLength: Line is too long. [102/80] samples = jobs.select { |job| job.name.start_with?('rspec-pg') && !job.name.include?('rails4') } ^^^^^^^^^^^^^^^^^^^^^^ bin/runner_timings:87:81: C: Metrics/LineLength: Line is too long. [116/80] output.puts([TimeHelpersformat_time(job.started_at), job.name, job.runner.description, job.duration].to_csv) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/runner_timings:103:5: C: Style/StderrPuts: Use warn instead of $stderr.puts to allow such output to be disabled. $stderr.puts "Please provide a valid project_path with the `-p/--project` option!" ^^^^^^^^^^^^ bin/runner_timings:103:18: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. $stderr.puts "Please provide a valid project_path with the `-p/--project` option!" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/runner_timings:103:81: C: Metrics/LineLength: Line is too long. [86/80] $stderr.puts "Please provide a valid project_path with the `-p/--project` option!" ^^^^^^ bin/runner_timings:108:4: C: Style/SpecialGlobalVars: Prefer $PROGRAM_NAME over $0. if $0 == __FILE__ ^^ bin/verification_matrix:16:81: C: Metrics/LineLength: Line is too long. [88/80] JobsDiff = Struct.new(:from, :to, :missing_jobs, :extra_jobs, :after_pipeline_status) do ^^^^^^^^ bin/verification_matrix:39:15: W: Lint/UselessAssignment: Useless assignment to variable - stderr_str. Use _ or _stderr_str as a variable name to indicate that it won't be used. stdout_str, stderr_str, status = Open3.capture3(command) ^^^^^^^^^^ bin/verification_matrix:39:27: W: Lint/UselessAssignment: Useless assignment to variable - status. Use _ or _status as a variable name to indicate that it won't be used. stdout_str, stderr_str, status = Open3.capture3(command) ^^^^^^ bin/verification_matrix:52:81: C: Metrics/LineLength: Line is too long. [167/80] table += "| #{desc} | #{jobs_diff.from} | #{jobs_diff.to} | `#{jobs_diff.missing_jobs}` | `#{jobs_diff.extra_jobs}` | #{jobs_diff.after_pipeline_status_emoji} |\n" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:58:81: C: Metrics/LineLength: Line is too long. [90/80] ########################################################################################## ^^^^^^^^^^ bin/verification_matrix:59:81: C: Metrics/LineLength: Line is too long. [90/80] # Following is an example of how to use the jobs_diff and jobs_comparison_table methods. # ^^^^^^^^^^ bin/verification_matrix:60:81: C: Metrics/LineLength: Line is too long. [90/80] ########################################################################################## ^^^^^^^^^^ bin/verification_matrix:62:81: C: Metrics/LineLength: Line is too long. [179/80] # code_ce_canonical_missing_jobs_diff = jobs_diff('https://gitlab.com/gitlab-org/gitlab-foss/pipelines/80243705', 'https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/32524') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:63:81: C: Metrics/LineLength: Line is too long. [174/80] # code_ce_fork_missing_jobs_diff = jobs_diff('https://gitlab.com/kominoshja/gitlab-foss/pipelines/80441647', 'https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/32655') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:64:81: C: Metrics/LineLength: Line is too long. [164/80] # code_ce_dev_missing_jobs_diff = jobs_diff('https://dev.gitlab.org/gitlab/gitlabhq/pipelines/125591', 'https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/3397') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:65:81: C: Metrics/LineLength: Line is too long. [167/80] code_ee_canonical_missing_jobs_diff = jobs_diff('https://gitlab.com/gitlab-org/gitlab/pipelines/80241102', 'https://gitlab.com/gitlab-org/gitlab/merge_requests/15761') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:66:81: C: Metrics/LineLength: Line is too long. [165/80] code_ee_fork_missing_jobs_diff = jobs_diff('https://gitlab.com/leetickett/gitlab-ee/pipelines/80210286', 'https://gitlab.com/gitlab-org/gitlab/merge_requests/16129') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:67:81: C: Metrics/LineLength: Line is too long. [164/80] code_ee_dev_missing_jobs_diff = jobs_diff('https://dev.gitlab.org/gitlab/gitlab-ee/pipelines/125594', 'https://dev.gitlab.org/gitlab/gitlab-ee/merge_requests/1259') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:74:44: C: Layout/MultilineMethodCallBraceLayout: Closing method call brace must be on the line after the last argument when opening brace is on a separate line from the first argument. 'EE dev' => code_ee_dev_missing_jobs_diff) ^ bin/verification_matrix:76:81: C: Metrics/LineLength: Line is too long. [177/80] # qa_ce_canonical_missing_jobs_diff = jobs_diff('https://gitlab.com/gitlab-org/gitlab-foss/pipelines/80455814', 'https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/32549') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:77:81: C: Metrics/LineLength: Line is too long. [167/80] # qa_ce_fork_missing_jobs_diff = jobs_diff('https://gitlab.com/rymai/gitlab-foss/pipelines/80268554', 'https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/32550') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:78:81: C: Metrics/LineLength: Line is too long. [162/80] # qa_ce_dev_missing_jobs_diff = jobs_diff('https://dev.gitlab.org/gitlab/gitlabhq/pipelines/125592', 'https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/3398') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:79:81: C: Metrics/LineLength: Line is too long. [165/80] qa_ee_canonical_missing_jobs_diff = jobs_diff('https://gitlab.com/gitlab-org/gitlab/pipelines/80455813', 'https://gitlab.com/gitlab-org/gitlab/merge_requests/16017') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:80:81: C: Metrics/LineLength: Line is too long. [158/80] qa_ee_fork_missing_jobs_diff = jobs_diff('https://gitlab.com/rymai/gitlab-ee/pipelines/80268787', 'https://gitlab.com/gitlab-org/gitlab/merge_requests/16018') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:81:81: C: Metrics/LineLength: Line is too long. [162/80] qa_ee_dev_missing_jobs_diff = jobs_diff('https://dev.gitlab.org/gitlab/gitlab-ee/pipelines/125595', 'https://dev.gitlab.org/gitlab/gitlab-ee/merge_requests/1260') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:88:42: C: Layout/MultilineMethodCallBraceLayout: Closing method call brace must be on the line after the last argument when opening brace is on a separate line from the first argument. 'EE dev' => qa_ee_dev_missing_jobs_diff) ^ bin/verification_matrix:90:81: C: Metrics/LineLength: Line is too long. [179/80] # docs_ce_canonical_missing_jobs_diff = jobs_diff('https://gitlab.com/gitlab-org/gitlab-foss/pipelines/80146043', 'https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/32545') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:91:81: C: Metrics/LineLength: Line is too long. [169/80] # docs_ce_fork_missing_jobs_diff = jobs_diff('https://gitlab.com/rymai/gitlab-foss/pipelines/80270275', 'https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/32547') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:92:81: C: Metrics/LineLength: Line is too long. [164/80] # docs_ce_dev_missing_jobs_diff = jobs_diff('https://dev.gitlab.org/gitlab/gitlabhq/pipelines/125593', 'https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/3399') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:93:81: C: Metrics/LineLength: Line is too long. [167/80] docs_ee_canonical_missing_jobs_diff = jobs_diff('https://gitlab.com/gitlab-org/gitlab/pipelines/80459631', 'https://gitlab.com/gitlab-org/gitlab/merge_requests/16015') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:94:81: C: Metrics/LineLength: Line is too long. [160/80] docs_ee_fork_missing_jobs_diff = jobs_diff('https://gitlab.com/rymai/gitlab-ee/pipelines/80270205', 'https://gitlab.com/gitlab-org/gitlab/merge_requests/16016') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:95:81: C: Metrics/LineLength: Line is too long. [164/80] docs_ee_dev_missing_jobs_diff = jobs_diff('https://dev.gitlab.org/gitlab/gitlab-ee/pipelines/125596', 'https://dev.gitlab.org/gitlab/gitlab-ee/merge_requests/1261') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:102:44: C: Layout/MultilineMethodCallBraceLayout: Closing method call brace must be on the line after the last argument when opening brace is on a separate line from the first argument. 'EE dev' => docs_ee_dev_missing_jobs_diff) ^ bin/verification_matrix:104:81: C: Metrics/LineLength: Line is too long. [161/80] code_ee_geo_missing_jobs_diff = jobs_diff('https://gitlab.com/gitlab-org/gitlab/pipelines/80518212', 'https://gitlab.com/gitlab-org/gitlab/merge_requests/16184') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/verification_matrix:106:62: C: Layout/MultilineMethodCallBraceLayout: Closing method call brace must be on the line after the last argument when opening brace is on a separate line from the first argument. 'Geo branch (code change)' => code_ee_geo_missing_jobs_diff) ^ bin/verification_matrix:109:1: C: Layout/IndentHeredoc: Use 2 spaces for indentation in a heredoc. CE port (not needed anymore): https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/32524 ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/leak_detector_in_issues:26:81: C: Metrics/LineLength: Line is too long. [87/80] opts.on('-t', '--token ACESS_TOKEN', String, 'A valid access token') do |value| ^^^^^^^ bin/leak_detector_in_issues:30:81: C: Metrics/LineLength: Line is too long. [131/80] opts.on('-p', '--project PROJECT_ID', String, 'A valid project ID. Can be an integer or a group/project string') do |value| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/leak_detector_in_issues:34:81: C: Metrics/LineLength: Line is too long. [81/80] opts.on('-n', '--needle NEEDLE', String, 'A string to search') do |value| ^ bin/leak_detector_in_issues:38:81: C: Metrics/LineLength: Line is too long. [141/80] opts.on('-a', '--api-endpoint API_ENDPOINT', String, 'A valid GitLab API endpoint, defaults to https://gitlab.com/api/v4') do |value| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/leak_detector_in_issues:42:81: C: Metrics/LineLength: Line is too long. [127/80] opts.on('-f', '--title-filter TITLE_FILTER', String, 'Only search issues for which title match this filter') do |value| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/leak_detector_in_issues:59:26: C: Style/RedundantFreeze: Do not freeze immutable objects, as freezing them has no effect. DEFAULT_API_ENDPOINT = 'https://gitlab.com/api/v4'.freeze ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/leak_detector_in_issues:99:5: C: Style/StderrPuts: Use warn instead of $stderr.puts to allow such output to be disabled. $stderr.puts "Please provide a valid project ID with the `-p/--project` option!" ^^^^^^^^^^^^ bin/leak_detector_in_issues:99:18: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. $stderr.puts "Please provide a valid project ID with the `-p/--project` option!" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/leak_detector_in_issues:99:81: C: Metrics/LineLength: Line is too long. [84/80] $stderr.puts "Please provide a valid project ID with the `-p/--project` option!" ^^^^ bin/leak_detector_in_issues:103:3: W: Lint/DuplicateMethods: Method LeakDetectorInIssues#leaking_urls is defined at both bin/leak_detector_in_issues:62 and bin/leak_detector_in_issues:103. def leaking_urls ^^^^^^^^^^^^^^^^ bin/leak_detector_in_issues:103:3: C: Metrics/CyclomaticComplexity: Cyclomatic complexity for leaking_urls is too high. [7/6] def leaking_urls ... ^^^^^^^^^^^^^^^^ bin/leak_detector_in_issues:105:81: C: Metrics/LineLength: Line is too long. [117/80] Gitlab.issues(project, search: title_filter, per_page: 100).auto_paginate.each_with_object([]) do |issue, memo| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/leak_detector_in_issues:113:81: C: Metrics/LineLength: Line is too long. [85/80] Gitlab.issue_notes(project, issue.iid, per_page: 100).auto_paginate do |note| ^^^^^ bin/leak_detector_in_issues:116:81: C: Metrics/LineLength: Line is too long. [81/80] memo << "#{issue.web_url}#note_#{note.id}" if detect_in_text(note.body) ^ bin/leak_detector_in_issues:123:5: C: Style/DoubleNegation: Avoid the use of double negation (!!). !!(text =~ needle_pattern) ^ bin/leak_detector_in_issues:127:4: C: Style/SpecialGlobalVars: Prefer $PROGRAM_NAME over $0. if $0 == __FILE__ ^^ bin/leak_detector_in_issues:129:81: C: Metrics/LineLength: Line is too long. [83/80] detector = LeakDetectorInIssues.new(LeakDetectorInIssuesOptionParser.parse(ARGV)) ^^^ bin/log_pipelines:35:81: C: Metrics/LineLength: Line is too long. [85/80] opts.on('-t', '--token ACESS_TOKEN', String, 'A valid access token') do |value| ^^^^^ bin/log_pipelines:39:81: C: Metrics/LineLength: Line is too long. [82/80] opts.on('-p', '--project PROJECT_PATH', String, 'A project path') do |value| ^^ bin/log_pipelines:54:16: C: Style/RedundantFreeze: Do not freeze immutable objects, as freezing them has no effect. GITLAB_API = 'https://gitlab.com/api/v4'.freeze ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/log_pipelines:69:3: C: Metrics/AbcSize: Assignment Branch Condition size for process is too high. [36.25/30] def process ... ^^^^^^^^^^^ bin/log_pipelines:70:81: C: Metrics/LineLength: Line is too long. [97/80] FileUtils.mkdir_p(File.join(File.expand_path('../logs', __dir__), project_path, 'pipelines')) ^^^^^^^^^^^^^^^^^ bin/log_pipelines:84:81: C: Metrics/LineLength: Line is too long. [109/80] Gitlab.pipeline_jobs(project_path, pipeline.id, scope: 'success', per_page: 100).auto_paginate do |job| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/log_pipelines:90:16: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. warn "Cutoff reached, exiting" ^^^^^^^^^^^^^^^^^^^^^^^^^ bin/log_pipelines:94:81: C: Metrics/LineLength: Line is too long. [93/80] output.puts([TimeHelpers.format_time(job.started_at), job.name, job.duration].to_csv) ^^^^^^^^^^^^^ bin/log_pipelines:109:5: C: Style/StderrPuts: Use warn instead of $stderr.puts to allow such output to be disabled. $stderr.puts "Please provide a valid project_path with the `-p/--project` option!" ^^^^^^^^^^^^ bin/log_pipelines:109:18: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. $stderr.puts "Please provide a valid project_path with the `-p/--project` option!" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/log_pipelines:109:81: C: Metrics/LineLength: Line is too long. [86/80] $stderr.puts "Please provide a valid project_path with the `-p/--project` option!" ^^^^^^ bin/log_pipelines:114:4: C: Style/SpecialGlobalVars: Prefer $PROGRAM_NAME over $0. if $0 == __FILE__ ^^ bin/build_durations:24:81: C: Metrics/LineLength: Line is too long. [85/80] opts.on('-t', '--token ACESS_TOKEN', String, 'A valid access token') do |value| ^^^^^ bin/build_durations:43:16: C: Style/RedundantFreeze: Do not freeze immutable objects, as freezing them has no effect. GITLAB_API = 'https://gitlab.com/api/v4'.freeze ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/build_durations:44:17: C: Style/MutableConstant: Freeze mutable objects assigned to constants. URL_PATTERN = %r{ ... ^^^ bin/build_durations:90:7: C: Layout/CommentIndentation: Incorrect indentation detected (column 6 instead of 4). # .reject { |stat| stat.duration < MINIMUM_DURATION } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/build_durations:97:81: C: Metrics/LineLength: Line is too long. [108/80] Gitlab.pipeline_jobs(params[:project], params[:pipeline_id], per_page: 100).auto_paginate do |job| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/build_durations:119:81: C: Metrics/LineLength: Line is too long. [81/80] (sorted_array[(len - 1) / 2].duration + sorted_array[len / 2].duration) / 2.0 ^ bin/build_durations:127:25: C: Style/RegexpLiteral: Use // around regular expression. match = trace.match(%r{.*Knapsack report was generated\. Preview:(.*)Knapsack global time execution.*}m) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/build_durations:127:81: C: Metrics/LineLength: Line is too long. [108/80] match = trace.match(%r{.*Knapsack report was generated\. Preview:(.*)Knapsack global time execution.*}m) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/build_durations:134:25: C: Style/RegexpLiteral: Use // around regular expression. match = trace.match(%r{^Knapsack global time execution for tests: (?\d+h)?\s?(?\d+m)?\s?(?\d+s)?\s?$}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/build_durations:134:81: C: Metrics/LineLength: Line is too long. [131/80] match = trace.match(%r{^Knapsack global time execution for tests: (?\d+h)?\s?(?\d+m)?\s?(?\d+s)?\s?$}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/build_durations:137:81: C: Metrics/LineLength: Line is too long. [87/80] (match[:hours].to_i * 60 * 60) + (match[:minutes].to_i * 60) + match[:seconds].to_i ^^^^^^^ bin/build_durations:141:25: C: Style/RegexpLiteral: Use // around regular expression. match = trace.match(%r{^Finished in (?\d+) minutes? (?\d+) seconds?.*$}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/build_durations:141:81: C: Metrics/LineLength: Line is too long. [94/80] match = trace.match(%r{^Finished in (?\d+) minutes? (?\d+) seconds?.*$}) ^^^^^^^^^^^^^^ bin/build_durations:158:3: C: Metrics/AbcSize: Assignment Branch Condition size for save_durations_to_file is too high. [53.61/30] def save_durations_to_file ... ^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/build_durations:171:20: C: Style/FormatString: Favor format over sprintf. difference = sprintf("%0.2f", (stat.duration - average_duration) / 60) ^^^^^^^ bin/build_durations:171:28: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. difference = sprintf("%0.2f", (stat.duration - average_duration) / 60) ^^^^^^^ bin/build_durations:173:81: C: Metrics/LineLength: Line is too long. [92/80] puts "#{stat.name} #{difference.rjust(5)}m longer than average -- #{stat.job.web_url}" ^^^^^^^^^^^^ bin/build_durations:177:81: C: Metrics/LineLength: Line is too long. [102/80] timings = { job: stat.duration.round, knapsack: knapsack_time(trace), rspec: rspec_time(trace) } ^^^^^^^^^^^^^^^^^^^^^^ bin/build_durations:178:81: C: Metrics/LineLength: Line is too long. [125/80] puts " Knapsack: #{minutes(timings[:knapsack])} / RSpec: #{minutes(timings[:rspec])} / Job: #{minutes(timings[:job])}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/build_durations:189:52: C: Style/FormatString: Favor format over sprintf. puts " #{time.round(2).to_s.rjust(7)} #{sprintf("%d%%", time_percentage * 100).rjust(4)} #{file}" ^^^^^^^ bin/build_durations:189:60: C: Style/StringLiteralsInInterpolation: Prefer single-quoted strings inside interpolations. puts " #{time.round(2).to_s.rjust(7)} #{sprintf("%d%%", time_percentage * 100).rjust(4)} #{file}" ^^^^^^ bin/build_durations:189:61: C: Style/FormatStringToken: Prefer annotated tokens (like %s) over unannotated tokens (like %s). puts " #{time.round(2).to_s.rjust(7)} #{sprintf("%d%%", time_percentage * 100).rjust(4)} #{file}" ^^ bin/build_durations:189:81: C: Metrics/LineLength: Line is too long. [108/80] puts " #{time.round(2).to_s.rjust(7)} #{sprintf("%d%%", time_percentage * 100).rjust(4)} #{file}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/build_durations:198:4: C: Style/SpecialGlobalVars: Prefer $PROGRAM_NAME over $0. if $0 == __FILE__ ^^ bin/build_durations:199:6: C: Style/ZeroLengthPredicate: Use empty? instead of length < 1. if ARGV.length < 1 ^^^^^^^^^^^^^^^ bin/build_durations:200:5: C: Style/StderrPuts: Use warn instead of $stderr.puts to allow such output to be disabled. $stderr.puts BuildDurationsOptionParser.parse(%w[--help]) ^^^^^^^^^^^^ bin/pipeline_stages:22:81: C: Metrics/LineLength: Line is too long. [82/80] opts.on('-p', '--project PROJECT_PATH', String, 'A project path') do |value| ^^ bin/pipeline_stages:26:81: C: Metrics/LineLength: Line is too long. [98/80] opts.on('-j', '--job JOB_NAME', String, 'A job name to get average duration for') do |value| ^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:65:5: C: Style/StderrPuts: Use warn instead of $stderr.puts to allow such output to be disabled. $stderr.puts "Please provide a valid project_path with the `-p/--project` option!" ^^^^^^^^^^^^ bin/pipeline_stages:65:18: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. $stderr.puts "Please provide a valid project_path with the `-p/--project` option!" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:65:81: C: Metrics/LineLength: Line is too long. [86/80] $stderr.puts "Please provide a valid project_path with the `-p/--project` option!" ^^^^^^ bin/pipeline_stages:80:27: W: Lint/UnusedBlockArgument: Unused block argument - pipeline. If it's necessary, use _ or _pipeline as an argument name to indicate that it won't be used. pipeline_and_jobs do |pipeline, jobs| ^^^^^^^^ bin/pipeline_stages:84:81: C: Metrics/LineLength: Line is too long. [102/80] selected_jobs << Job.new(selected_job.name, selected_job.started_at.to_s, selected_job.duration) ^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:93:81: C: Metrics/LineLength: Line is too long. [140/80] puts "Average duration for the #{job_name} job: #{grand_average_duration} seconds (#{(grand_average_duration / 60).round(2)} minutes)" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:97:3: C: Metrics/AbcSize: Assignment Branch Condition size for process_by_stage is too high. [75.13/30] def process_by_stage ... ^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:97:3: C: Metrics/MethodLength: Method has too many lines. [41/30] def process_by_stage ... ^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:99:81: C: Metrics/LineLength: Line is too long. [110/80] output.puts(%w[date pipeline_id stage jobs_in_stage slowest_job slowest_duration average_duration].to_csv) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:100:36: C: Layout/SpaceAfterComma: Space missing after comma. stats_per_stage = Hash.new { |h,k| h[k] = { duration: 0, slowest: [] } } ^ bin/pipeline_stages:109:15: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. print " " + "#{stage} (#{stage_jobs.size}):".ljust(15) ^^^^^^ bin/pipeline_stages:110:81: C: Metrics/LineLength: Line is too long. [81/80] print " #{slowest.normalized_name} (#{slowest.duration}, #{average} avg)" ^ bin/pipeline_stages:111:81: C: Metrics/LineLength: Line is too long. [81/80] stats_per_stage[stage][:duration] += stage_finished_at - stage_started_at ^ bin/pipeline_stages:112:81: C: Metrics/LineLength: Line is too long. [91/80] stats_per_stage[stage][:slowest] << { slowest.normalized_name => slowest.duration } ^^^^^^^^^^^ bin/pipeline_stages:131:10: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. puts "Average duration of each stage:" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:134:81: C: Metrics/LineLength: Line is too long. [112/80] puts "- #{stage}: #{avg_duration_in_seconds} seconds (#{(avg_duration_in_seconds / 60).round(2)} minutes)" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:138:10: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. puts "Slowest job per stage:" ^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:140:81: C: Metrics/LineLength: Line is too long. [122/80] # most_slowest_job = stats[:slowest].group_by(&:first).transform_values { |v| v.size }.sort_by { |_, count| -count } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:141:72: C: Layout/SpaceAfterComma: Space missing after comma. most_slowest_job = stats[:slowest].each_with_object(Hash.new { |h,k| h[k] = 0 }) { |hash, memo| memo[hash.first[0]] += hash.first[1] }.transform_values { |v| v.to_f / pipelines.size }.sort_by { |_, avg_duration| -avg_duration } ^ bin/pipeline_stages:141:81: C: Metrics/LineLength: Line is too long. [233/80] most_slowest_job = stats[:slowest].each_with_object(Hash.new { |h,k| h[k] = 0 }) { |hash, memo| memo[hash.first[0]] += hash.first[1] }.transform_values { |v| v.to_f / pipelines.size }.sort_by { |_, avg_duration| -avg_duration } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:142:81: C: Metrics/LineLength: Line is too long. [145/80] puts "- #{stage}: #{most_slowest_job.map { |job, avg_duration| "#{job} (#{(avg_duration / 60).round(2)} minutes on average)" }.join(', ')}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:151:81: C: Metrics/LineLength: Line is too long. [110/80] output.puts(%w[date pipeline_id stage jobs_in_stage slowest_job slowest_duration average_duration].to_csv) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:158:15: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. print " " << "#{group} (#{group_jobs.size}):".ljust(15) ^^^^^^ bin/pipeline_stages:201:21: C: Style/WordArray: Use %w or %W for an array of words. PREPARE_JOBS = ['retrieve-tests-metadata', 'compile-assets', 'setup-test-env'].freeze ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:201:81: C: Metrics/LineLength: Line is too long. [90/80] PREPARE_JOBS = ['retrieve-tests-metadata', 'compile-assets', 'setup-test-env'].freeze ^^^^^^^^^^ bin/pipeline_stages:202:81: C: Metrics/LineLength: Line is too long. [92/80] LINT_JOBS = ['static-analysis', 'docs lint', 'no_ee_check', 'lint-ci-gitlab'].freeze ^^^^^^^^^^^^ bin/pipeline_stages:203:21: C: Style/WordArray: Use %w or %W for an array of words. SCANNING_JOBS = ['code_quality', 'dependency_scanning', 'sast'].freeze ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:205:81: C: Metrics/LineLength: Line is too long. [90/80] POST_JOBS = ['coverage', 'lint:javascript:report', 'update-tests-metadata'].freeze ^^^^^^^^^^ bin/pipeline_stages:206:21: C: Style/WordArray: Use %w or %W for an array of words. REVIEW_JOBS = ['review-deploy', 'review-stop', 'package-and-qa', 'review-docs-deploy-manual'].freeze ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:206:81: C: Metrics/LineLength: Line is too long. [106/80] REVIEW_JOBS = ['review-deploy', 'review-stop', 'package-and-qa', 'review-docs-deploy-manual'].freeze ^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:208:12: C: Style/MutableConstant: Freeze mutable objects assigned to constants. GROUPS = { ... ^ bin/pipeline_stages:209:5: C: Layout/AlignHash: Align the elements of a hash literal if they span more than one line. assets: -> (name) { name == 'gitlab:assets:compile' }, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:209:17: C: Layout/SpaceInLambdaLiteral: Do not use spaces between -> and ( in lambda literals. assets: -> (name) { name == 'gitlab:assets:compile' }, ^^^^^^^^^ bin/pipeline_stages:210:5: C: Layout/AlignHash: Align the elements of a hash literal if they span more than one line. cache: -> (name) { name == 'cache gems' }, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:210:17: C: Layout/SpaceInLambdaLiteral: Do not use spaces between -> and ( in lambda literals. cache: -> (name) { name == 'cache gems' }, ^^^^^^^^^ bin/pipeline_stages:211:5: C: Layout/AlignHash: Align the elements of a hash literal if they span more than one line. db: -> (name) { name.start_with?('db:', 'migration:') || name.start_with?('gitlab:setup-') }, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:211:17: C: Layout/SpaceInLambdaLiteral: Do not use spaces between -> and ( in lambda literals. db: -> (name) { name.start_with?('db:', 'migration:') || name.start_with?('gitlab:setup-') }, ^^^^^^^^^ bin/pipeline_stages:211:81: C: Metrics/LineLength: Line is too long. [105/80] db: -> (name) { name.start_with?('db:', 'migration:') || name.start_with?('gitlab:setup-') }, ^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:212:5: C: Layout/AlignHash: Align the elements of a hash literal if they span more than one line. git: -> (name) { name == 'gitlab_git_test' }, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:212:17: C: Layout/SpaceInLambdaLiteral: Do not use spaces between -> and ( in lambda literals. git: -> (name) { name == 'gitlab_git_test' }, ^^^^^^^^^ bin/pipeline_stages:213:17: C: Layout/SpaceInLambdaLiteral: Do not use spaces between -> and ( in lambda literals. javascript: -> (name) { JAVASCRIPT_JOBS.include?(name) }, ^^^^^^^^^ bin/pipeline_stages:214:5: C: Layout/AlignHash: Align the elements of a hash literal if they span more than one line. lint: -> (name) { LINT_JOBS.include?(name) }, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:214:17: C: Layout/SpaceInLambdaLiteral: Do not use spaces between -> and ( in lambda literals. lint: -> (name) { LINT_JOBS.include?(name) }, ^^^^^^^^^ bin/pipeline_stages:215:5: C: Layout/AlignHash: Align the elements of a hash literal if they span more than one line. pages: -> (name) { name == 'pages' }, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:215:17: C: Layout/SpaceInLambdaLiteral: Do not use spaces between -> and ( in lambda literals. pages: -> (name) { name == 'pages' }, ^^^^^^^^^ bin/pipeline_stages:216:5: C: Layout/AlignHash: Align the elements of a hash literal if they span more than one line. post: -> (name) { POST_JOBS.include?(name) }, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:216:17: C: Layout/SpaceInLambdaLiteral: Do not use spaces between -> and ( in lambda literals. post: -> (name) { POST_JOBS.include?(name) }, ^^^^^^^^^ bin/pipeline_stages:217:5: C: Layout/AlignHash: Align the elements of a hash literal if they span more than one line. prepare: -> (name) { PREPARE_JOBS.include?(name) }, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:217:17: C: Layout/SpaceInLambdaLiteral: Do not use spaces between -> and ( in lambda literals. prepare: -> (name) { PREPARE_JOBS.include?(name) }, ^^^^^^^^^ bin/pipeline_stages:218:5: C: Layout/AlignHash: Align the elements of a hash literal if they span more than one line. rspec: -> (name) { name.start_with?('rspec') && !name.end_with?('ee') && !name.include?('geo') }, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:218:17: C: Layout/SpaceInLambdaLiteral: Do not use spaces between -> and ( in lambda literals. rspec: -> (name) { name.start_with?('rspec') && !name.end_with?('ee') && !name.include?('geo') }, ^^^^^^^^^ bin/pipeline_stages:218:81: C: Metrics/LineLength: Line is too long. [106/80] rspec: -> (name) { name.start_with?('rspec') && !name.end_with?('ee') && !name.include?('geo') }, ^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:219:5: C: Layout/AlignHash: Align the elements of a hash literal if they span more than one line. rspec_ee: -> (name) { name.start_with?('rspec') && (name.end_with?('ee') || name.include?('geo')) }, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:219:17: C: Layout/SpaceInLambdaLiteral: Do not use spaces between -> and ( in lambda literals. rspec_ee: -> (name) { name.start_with?('rspec') && (name.end_with?('ee') || name.include?('geo')) }, ^^^^^^^^^ bin/pipeline_stages:219:81: C: Metrics/LineLength: Line is too long. [106/80] rspec_ee: -> (name) { name.start_with?('rspec') && (name.end_with?('ee') || name.include?('geo')) }, ^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:220:5: C: Layout/AlignHash: Align the elements of a hash literal if they span more than one line. scanning: -> (name) { SCANNING_JOBS.include?(name) }, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:220:17: C: Layout/SpaceInLambdaLiteral: Do not use spaces between -> and ( in lambda literals. scanning: -> (name) { SCANNING_JOBS.include?(name) }, ^^^^^^^^^ bin/pipeline_stages:221:5: C: Layout/AlignHash: Align the elements of a hash literal if they span more than one line. review: -> (name) { REVIEW_JOBS.include?(name) }, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:221:17: C: Layout/SpaceInLambdaLiteral: Do not use spaces between -> and ( in lambda literals. review: -> (name) { REVIEW_JOBS.include?(name) }, ^^^^^^^^^ bin/pipeline_stages:222:19: C: Layout/SpaceInLambdaLiteral: Do not use spaces between -> and ( in lambda literals. review_build: -> (name) { name.include?('review-build-cng') }, ^^^^^^^^^ bin/pipeline_stages:223:5: C: Layout/AlignHash: Align the elements of a hash literal if they span more than one line. qa: -> (name) { name.start_with?('qa:', 'qa-', 'review-qa-', 'review-performance') }, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/pipeline_stages:223:17: C: Layout/SpaceInLambdaLiteral: Do not use spaces between -> and ( in lambda literals. qa: -> (name) { name.start_with?('qa:', 'qa-', 'review-qa-', 'review-performance') }, ^^^^^^^^^ bin/pipeline_stages:223:81: C: Metrics/LineLength: Line is too long. [97/80] qa: -> (name) { name.start_with?('qa:', 'qa-', 'review-qa-', 'review-performance') }, ^^^^^^^^^^^^^^^^^ bin/pipeline_stages:223:97: C: Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash. qa: -> (name) { name.start_with?('qa:', 'qa-', 'review-qa-', 'review-performance') }, ^ bin/pipeline_stages:226:12: C: Style/MutableConstant: Freeze mutable objects assigned to constants. STAGES = { ... ^ bin/pipeline_stages:243:3: W: Lint/DuplicateMethods: Method Job#group is defined at both bin/pipeline_stages:234 and bin/pipeline_stages:243. def group ^^^^^^^^^ bin/pipeline_stages:247:3: W: Lint/DuplicateMethods: Method Job#stage is defined at both bin/pipeline_stages:234 and bin/pipeline_stages:247. def stage ^^^^^^^^^ bin/pipeline_stages:260:14: C: Style/RegexpLiteral: Use %r around regular expression. name.sub(/\d+(\s|\/)\d+$/, '').strip ^^^^^^^^^^^^^^^^ bin/pipeline_stages:278:4: C: Style/SpecialGlobalVars: Prefer $PROGRAM_NAME over $0. if $0 == __FILE__ ^^ bin/toggle_feature_flag_for_group_resources:26:81: C: Metrics/LineLength: Line is too long. [93/80] opts.on('-t', '--token ACESS_TOKEN', String, 'A valid admin access token') do |value| ^^^^^^^^^^^^^ bin/toggle_feature_flag_for_group_resources:34:81: C: Metrics/LineLength: Line is too long. [84/80] opts.on('-f', '--feature FEATURE_FLAG', String, 'A feature flag') do |value| ^^^^ bin/toggle_feature_flag_for_group_resources:38:81: C: Metrics/LineLength: Line is too long. [114/80] opts.on('-v', '--value', 'Pass "false" or "0" to disable the feature flag. Default to "true".') do |value| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/toggle_feature_flag_for_group_resources:42:81: C: Metrics/LineLength: Line is too long. [109/80] opts.on('-u', '--dry-run', 'Perform a dry run without actually toggling the feature flag') do |value| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/toggle_feature_flag_for_group_resources:59:16: C: Style/RedundantFreeze: Do not freeze immutable objects, as freezing them has no effect. GITLAB_API = 'https://gitlab.com/api/v4'.freeze ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/toggle_feature_flag_for_group_resources:87:81: C: Metrics/LineLength: Line is too long. [109/80] @subgroups = Gitlab.group_subgroups(group.id).auto_paginate.each_with_object([]) do |subgroup, subgroups| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/toggle_feature_flag_for_group_resources:89:5: C: Style/MultilineBlockChain: Avoid multi-line chains of blocks. end.tap do |subgroups| ^^^^^^^ bin/toggle_feature_flag_for_group_resources:90:81: C: Metrics/LineLength: Line is too long. [87/80] puts "#{subgroups.size} subgroups were found under the #{group.full_path} group." ^^^^^^^ bin/toggle_feature_flag_for_group_resources:99:81: C: Metrics/LineLength: Line is too long. [150/80] @projects = Gitlab.group_projects(group.id, include_subgroups: true, with_shared: false).auto_paginate.each_with_object([]) do |project, projects| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/toggle_feature_flag_for_group_resources:101:5: C: Style/MultilineBlockChain: Avoid multi-line chains of blocks. end.tap do |projects| ^^^^^^^ bin/toggle_feature_flag_for_group_resources:102:81: C: Metrics/LineLength: Line is too long. [85/80] puts "#{projects.size} projects were found under the #{group.full_path} group." ^^^^^ bin/toggle_feature_flag_for_group_resources:106:7: C: Naming/AccessorMethodName: Do not prefix writer method names with set_. def set_feature_flag!(value) ^^^^^^^^^^^^^^^^^ bin/toggle_feature_flag_for_group_resources:108:81: C: Metrics/LineLength: Line is too long. [110/80] puts "#{'[DRY RUN] ' if dry_run}Enabling the #{feature_flag} feature flag for the #{subgroup} subgroup." ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/toggle_feature_flag_for_group_resources:113:81: C: Metrics/LineLength: Line is too long. [108/80] puts "#{'[DRY RUN] ' if dry_run}Enabling the #{feature_flag} feature flag for the #{project} project." ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/toggle_feature_flag_for_group_resources:123:5: C: Style/StderrPuts: Use warn instead of $stderr.puts to allow such output to be disabled. $stderr.puts "Please provide a valid group_path with the `-g/--group` option!" ^^^^^^^^^^^^ bin/toggle_feature_flag_for_group_resources:123:18: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. $stderr.puts "Please provide a valid group_path with the `-g/--group` option!" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/toggle_feature_flag_for_group_resources:123:81: C: Metrics/LineLength: Line is too long. [82/80] $stderr.puts "Please provide a valid group_path with the `-g/--group` option!" ^^ bin/toggle_feature_flag_for_group_resources:130:5: C: Style/StderrPuts: Use warn instead of $stderr.puts to allow such output to be disabled. $stderr.puts "Please provide a valid feature_flag with the `-f/--feature` option!" ^^^^^^^^^^^^ bin/toggle_feature_flag_for_group_resources:130:18: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. $stderr.puts "Please provide a valid feature_flag with the `-f/--feature` option!" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/toggle_feature_flag_for_group_resources:130:81: C: Metrics/LineLength: Line is too long. [86/80] $stderr.puts "Please provide a valid feature_flag with the `-f/--feature` option!" ^^^^^^ bin/toggle_feature_flag_for_group_resources:135:4: C: Style/SpecialGlobalVars: Prefer $PROGRAM_NAME over $0. if $0 == __FILE__ ^^ bin/flaky_report:1:1: C: Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true. #!/usr/bin/env ruby ^ bin/flaky_report:21:81: C: Metrics/LineLength: Line is too long. [103/80] opts.on('-f', '--report-file REPORT_FILE', String, 'A JSON flaky specs report file') do |value| ^^^^^^^^^^^^^^^^^^^^^^^ bin/flaky_report:25:81: C: Metrics/LineLength: Line is too long. [130/80] opts.on('-g', '--group-by [file,type,date,reports]', String, 'Group by file (default), type, date, or reports') do |value| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/flaky_report:29:81: C: Metrics/LineLength: Line is too long. [97/80] opts.on('-l', '--limit LIMIT', Integer, 'Limit the number of lines displayed') do |value| ^^^^^^^^^^^^^^^^^ bin/flaky_report:50:81: C: Metrics/LineLength: Line is too long. [108/80] raise ArgumentError, 'Please provide a JSON flaky specs report file with the -f/--report-file option!' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/flaky_report:56:3: C: Metrics/AbcSize: Assignment Branch Condition size for print_report is too high. [62.9/30] def print_report(group_by: nil, limit: nil) ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/flaky_report:56:3: C: Metrics/CyclomaticComplexity: Cyclomatic complexity for print_report is too high. [9/6] def print_report(group_by: nil, limit: nil) ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/flaky_report:56:3: C: Metrics/MethodLength: Method has too many lines. [41/30] def print_report(group_by: nil, limit: nil) ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bin/flaky_report:60:81: C: Metrics/LineLength: Line is too long. [82/80] puts '-----------------------------------------------------------------------' ^^ bin/flaky_report:65:69: W: Lint/UnusedBlockArgument: Unused block argument - uid. If it's necessary, use _ or _uid as an argument name to indicate that it won't be used. report_by_file = report.each_with_object(Hash.new { 0 }) do |(uid, hash), memo| ^^^ bin/flaky_report:65:81: C: Metrics/LineLength: Line is too long. [85/80] report_by_file = report.each_with_object(Hash.new { 0 }) do |(uid, hash), memo| ^^^^^ bin/flaky_report:69:81: C: Metrics/LineLength: Line is too long. [95/80] report_by_file = report_by_file.sort_by { |_, count| count }.reverse.first(limit).reverse ^^^^^^^^^^^^^^^ bin/flaky_report:76:69: W: Lint/UnusedBlockArgument: Unused block argument - uid. If it's necessary, use _ or _uid as an argument name to indicate that it won't be used. report_by_type = report.each_with_object(Hash.new { 0 }) do |(uid, hash), memo| ^^^ bin/flaky_report:76:81: C: Metrics/LineLength: Line is too long. [85/80] report_by_type = report.each_with_object(Hash.new { 0 }) do |(uid, hash), memo| ^^^^^ bin/flaky_report:82:81: C: Metrics/LineLength: Line is too long. [95/80] report_by_type = report_by_type.sort_by { |_, count| count }.reverse.first(limit).reverse ^^^^^^^^^^^^^^^ bin/flaky_report:89:57: W: Lint/UnusedBlockArgument: Unused block argument - uid. If it's necessary, use _ or _uid as an argument name to indicate that it won't be used. report_by_date = report.each_with_object({}) do |(uid, hash), memo| ^^^ bin/flaky_report:94:81: C: Metrics/LineLength: Line is too long. [93/80] report_by_date = report_by_date.sort_by { |date, _| date }.reverse.first(limit).reverse ^^^^^^^^^^^^^ bin/flaky_report:101:81: C: Metrics/LineLength: Line is too long. [90/80] raise ArgumentError, 'Unknown group-by strategy: only :file and :date are supported' ^^^^^^^^^^ bin/flaky_report:106:81: C: Metrics/LineLength: Line is too long. [84/80] puts "-----------------------------------------------------------------------\n" ^^^^ bin/flaky_report:114:4: C: Style/SpecialGlobalVars: Prefer $PROGRAM_NAME over $0. if $0 == __FILE__ ^^ bin/flaky_report:118:81: C: Metrics/LineLength: Line is too long. [113/80] AnalyzeFlakySpecsReport.new(options.report_file).print_report(group_by: options.group_by, limit: options.limit) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lib/token_finder.rb:1:1: C: Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true. class TokenFinder ^ lib/token_finder.rb:28:5: C: Style/StderrPuts: Use warn instead of $stderr.puts to allow such output to be disabled. $stderr.puts "Please provide a valid access token with the `-t/--token` option or in the `#{token_file_path}` file!" ^^^^^^^^^^^^ lib/token_finder.rb:28:81: C: Metrics/LineLength: Line is too long. [120/80] $stderr.puts "Please provide a valid access token with the `-t/--token` option or in the `#{token_file_path}` file!" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lib/token_finder.rb:35:81: C: Metrics/LineLength: Line is too long. [91/80] @token_file_path ||= File.expand_path("../api_token#{"_#{suffix}" if suffix}", __dir__) ^^^^^^^^^^^ lib/time_helpers.rb:1:1: C: Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true. class TimeHelpers ^ 17 files inspected, 261 offenses detected
Edited by Dan Davison