saasbook/esaas-engagements

View on GitHub

Showing 25 of 71 total issues

Method send_form has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def send_form(name, email, url, iter, eng)
Severity: Minor
Found in app/mailers/form_mailer.rb - About 35 mins to fix

    Method propose has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def propose(team, team_preferences)
          team_preferences.each do |app|
            puts "Team preferences: " + team_preferences.to_s
            puts "Team " + team + " proposing to App " + app
            # Check if the app is currently matched
    Severity: Minor
    Found in app/models/matching.rb - About 35 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 store has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

      def store
        @matching = Matching.find(params[:matching_id])
        @engagement = Engagement.find(params[:engagement_id])
    
        # Update last update users
    Severity: Minor
    Found in app/controllers/matching_controller.rb - About 35 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 find_last_edit_user has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def self.find_last_edit_user(matching, engagement)
          matching.last_edit_users.each do |team, last_edit_user_id|
            if (team == engagement.team_number)
              if (last_edit_user_id == 0)
                return "Your team has not responded yet!"
    Severity: Minor
    Found in app/models/matching.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 find_user_engagement_id has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def self.find_user_engagement_id(user_id)
          dev_engagement = User.find(user_id).developing_engagement
          if !dev_engagement.nil?
            matching = dev_engagement.matching
            if !matching.nil?
    Severity: Minor
    Found in app/models/matching.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

    Severity
    Category
    Status
    Source
    Language