Codeminer42/cm42-central

View on GitHub

Showing 66 of 343 total issues

Function startDate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    startDate: function () {
      var start_date;
      if (this.get('start_date')) {
        // Parse the date string into an array of [YYYY, MM, DD] to
        // ensure identical date behaviour across browsers.
Severity: Minor
Found in app/assets/javascripts/models/project.js - About 25 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 resolve has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def resolve
      if root?
        Project.all
      elsif admin?
        current_team.projects
Severity: Minor
Found in app/policies/project_policy.rb - About 25 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 call has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def call
    project.stories
           .where(requested_by_id: user.id)
           .or(project.stories.where(owned_by_id: user.id))
           .where.not(state: "accepted").each do |story|
Severity: Minor
Found in app/services/remove_stories_from_user_service.rb - About 25 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 set_accepted_at has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def set_accepted_at
    return unless state_changed?
    return unless state == 'accepted'
    self.accepted_at = Time.current if accepted_at.nil?
    self.cycle_time = accepted_at - started_at if started_at
Severity: Minor
Found in app/models/story.rb - About 25 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

Function calculateVelocity has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    calculateVelocity: function () {
      if (this.doneIterations().length === 0) {
        return this.get('default_velocity');
      } else {
        // TODO Make number of iterations configurable
Severity: Minor
Found in app/assets/javascripts/models/project.js - About 25 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

Function canEdit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  canEdit: function () {
    var isEditable = this.model.get('editing');
    var isSearchResultContainer = this.$el.hasClass('searchResult');
    var clickFromSearchResult = this.model.get('clickFromSearchResult');
    if (_.isUndefined(isEditable)) isEditable = false;
Severity: Minor
Found in app/assets/javascripts/views/story_view.jsx - About 25 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

Severity
Category
Status
Source
Language