BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
04fcf3fa
Commit
04fcf3fa
authored
Apr 26, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '31362_decrease_cyclomatic_complexity_threshold_step1' into 'master'
Decrease Cyclomatic Complexity threshold to 16 See merge request !10928
parents
081dfc45
37c2c4a4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
41 deletions
+35
-41
.rubocop.yml
.rubocop.yml
+1
-1
31362_decrease_cyclomatic_complexity_threshold_step1.yml
.../31362_decrease_cyclomatic_complexity_threshold_step1.yml
+4
-0
importer.rb
lib/gitlab/google_code_import/importer.rb
+30
-40
No files found.
.rubocop.yml
View file @
04fcf3fa
...
...
@@ -562,7 +562,7 @@ Metrics/ClassLength:
# of test cases needed to validate a method.
Metrics/CyclomaticComplexity
:
Enabled
:
true
Max
:
1
7
Max
:
1
6
# Limit lines to 80 characters.
Metrics/LineLength
:
...
...
changelogs/unreleased/31362_decrease_cyclomatic_complexity_threshold_step1.yml
0 → 100644
View file @
04fcf3fa
---
title
:
Decrease Cyclomatic Complexity threshold to 16
merge_request
:
10928
author
:
Rydkin Maxim
lib/gitlab/google_code_import/importer.rb
View file @
04fcf3fa
module
Gitlab
module
GoogleCodeImport
class
Importer
attr_reader
:project
,
:repo
attr_reader
:project
,
:repo
,
:closed_statuses
NICE_LABEL_COLOR_HASH
=
{
'Status: New'
=>
'#428bca'
,
'Status: Accepted'
=>
'#5cb85c'
,
'Status: Started'
=>
'#8e44ad'
,
'Priority: Critical'
=>
'#ffcfcf'
,
'Priority: High'
=>
'#deffcf'
,
'Priority: Medium'
=>
'#fff5cc'
,
'Priority: Low'
=>
'#cfe9ff'
,
'Type: Defect'
=>
'#d9534f'
,
'Type: Enhancement'
=>
'#44ad8e'
,
'Type: Task'
=>
'#4b6dd0'
,
'Type: Review'
=>
'#8e44ad'
,
'Type: Other'
=>
'#7f8c8d'
}.
freeze
def
initialize
(
project
)
@project
=
project
...
...
@@ -161,45 +177,19 @@ module Gitlab
end
def
nice_label_color
(
name
)
case
name
when
/\AComponent:/
"#fff39e"
when
/\AOpSys:/
"#e2e2e2"
when
/\AMilestone:/
"#fee3ff"
when
"Status: New"
"#428bca"
when
"Status: Accepted"
"#5cb85c"
when
"Status: Started"
"#8e44ad"
when
"Priority: Critical"
"#ffcfcf"
when
"Priority: High"
"#deffcf"
when
"Priority: Medium"
"#fff5cc"
when
"Priority: Low"
"#cfe9ff"
when
"Type: Defect"
"#d9534f"
when
"Type: Enhancement"
"#44ad8e"
when
"Type: Task"
"#4b6dd0"
when
"Type: Review"
"#8e44ad"
when
"Type: Other"
"#7f8c8d"
when
*
@closed_statuses
.
map
{
|
s
|
nice_status_name
(
s
)
}
"#cfcfcf"
else
"#e2e2e2"
end
NICE_LABEL_COLOR_HASH
[
name
]
||
case
name
when
/\AComponent:/
'#fff39e'
when
/\AOpSys:/
'#e2e2e2'
when
/\AMilestone:/
'#fee3ff'
when
*
closed_statuses
.
map
{
|
s
|
nice_status_name
(
s
)
}
'#cfcfcf'
else
'#e2e2e2'
end
end
def
nice_label_name
(
name
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment