fga-gpp-mds/Falko-2017.2-BackEnd

View on GitHub

Showing 7 of 95 total issues

Method calculate_metrics has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def calculate_metrics(release)
sprint = release.sprints.last
if sprint.blank? || sprint.stories.blank?
return nil
else
Severity: Minor
Found in app/helpers/metric_helper.rb - About 1 hr to fix

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

def verifies_id(current_id, previous_id, component_type)
if component_type == "user" && current_id != 0
id = current_id
@user = User.find(params[:id].to_i)
elsif component_type == "user" && previous_id != 0
Severity: Minor
Found in app/helpers/validations_helper.rb - About 1 hr to fix

Method verifies_id has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def verifies_id(current_id, previous_id, component_type)
if component_type == "user" && current_id != 0
id = current_id
@user = User.find(params[:id].to_i)
elsif component_type == "user" && previous_id != 0
Severity: Minor
Found in app/helpers/validations_helper.rb - About 1 hr to fix

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

def calculate_metrics(release)
sprint = release.sprints.last
if sprint.blank? || sprint.stories.blank?
return nil
else
Severity: Minor
Found in app/helpers/metric_helper.rb - About 55 mins to fix

Method calculate_burndown has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def calculate_burndown(metric)
values = 0
 
for i in 0..(metric.length - 1)
if metric[i] <= 10 || metric[i] >= 200
Severity: Minor
Found in app/helpers/metric_helper.rb - About 45 mins to fix

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

def validate_stories(story_points, id, sprint_id)
current_user
verifies_id(id, sprint_id, "sprint")
release
project
Severity: Minor
Found in app/helpers/validations_helper.rb - About 25 mins to fix

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

def request_github_token
code_token = params[:code]
 
result = RestClient.post(
"https://github.com/login/oauth/access_token",
Severity: Minor
Found in app/controllers/users_controller.rb - About 25 mins to fix
Severity
Category
Status
Source
Language