fga-gpp-mds/Falko-2017.2-BackEnd

View on GitHub
app/helpers/metric_helper.rb

Summary

Maintainability
A
3 hrs
Test Coverage

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 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

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 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

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

There are no issues that match your filters.

Category
Status