diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-01 21:09:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-01 21:09:17 +0300 |
commit | d7774ee304809f81347ef814328a9d620fb5d1a5 (patch) | |
tree | 49926a39da24437deab200c74ca5d1bf4a96a8aa /spec/factories | |
parent | e92c95bf459ea6237b1fe1cbd3e6fc7d0eca8f85 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/ci/reports/codequality_degradations.rb | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/spec/factories/ci/reports/codequality_degradations.rb b/spec/factories/ci/reports/codequality_degradations.rb new file mode 100644 index 00000000000..d82157b457a --- /dev/null +++ b/spec/factories/ci/reports/codequality_degradations.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :codequality_degradation_1, class: Hash do + skip_create + + initialize_with do + { + "categories": [ + "Complexity" + ], + "check_name": "argument_count", + "content": { + "body": "" + }, + "description": "Avoid parameter lists longer than 5 parameters. [12/5]", + "fingerprint": "15cdb5c53afd42bc22f8ca366a08d547", + "location": { + "path": "file_a.rb", + "lines": { + "begin": 10, + "end": 10 + } + }, + "other_locations": [], + "remediation_points": 900000, + "severity": "major", + "type": "issue", + "engine_name": "structure" + }.with_indifferent_access + end + end + + factory :codequality_degradation_2, class: Hash do + skip_create + + initialize_with do + { + "categories": [ + "Complexity" + ], + "check_name": "argument_count", + "content": { + "body": "" + }, + "description": "Method `new_array` has 12 arguments (exceeds 4 allowed). Consider refactoring.", + "fingerprint": "f3bdc1e8c102ba5fbd9e7f6cda51c95e", + "location": { + "path": "file_a.rb", + "lines": { + "begin": 10, + "end": 10 + } + }, + "other_locations": [], + "remediation_points": 900000, + "severity": "major", + "type": "issue", + "engine_name": "structure" + }.with_indifferent_access + end + end + + factory :codequality_degradation_3, class: Hash do + skip_create + + initialize_with do + { + "type": "Issue", + "check_name": "Rubocop/Metrics/ParameterLists", + "description": "Avoid parameter lists longer than 5 parameters. [12/5]", + "categories": [ + "Complexity" + ], + "remediation_points": 550000, + "location": { + "path": "file_b.rb", + "positions": { + "begin": { + "column": 14, + "line": 10 + }, + "end": { + "column": 39, + "line": 10 + } + } + }, + "content": { + "body": "This cop checks for methods with too many parameters.\nThe maximum number of parameters is configurable.\nKeyword arguments can optionally be excluded from the total count." + }, + "engine_name": "rubocop", + "fingerprint": "ab5f8b935886b942d621399f5a2ca16e", + "severity": "minor" + }.with_indifferent_access + end + end +end |