Team-Delta/GitMyCurriculum

View on GitHub

Showing 7 of 7 total issues

Method create has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  def create
    build_resource(sign_up_params)

    if resource.save
      yield resource if block_given?
Severity: Minor
Found in app/controllers/registrations_controller.rb - About 1 hr 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 update has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  def update
    self.resource = resource_class.to_adapter.get!(send(:"current_#{resource_name}").to_key)
    prev_unconfirmed_email = resource.unconfirmed_email if resource.respond_to?(:unconfirmed_email)

    if update_resource(resource, account_update_params)
Severity: Minor
Found in app/controllers/registrations_controller.rb - About 1 hr 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 update has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def update
    self.resource = resource_class.reset_password_by_token(resource_params)
    yield resource if block_given?

    if resource.errors.empty?
Severity: Minor
Found in app/controllers/passwords_controller.rb - About 1 hr 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 redirect_to_place has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def redirect_to_place(redirect, username, query, tab, id)
Severity: Minor
Found in app/controllers/subscriptions_controller.rb - About 35 mins to fix

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

      def create_notification_for(type, author, curriculum, branch = nil, commit = nil)
    Severity: Minor
    Found in app/controllers/concerns/notification_manager.rb - About 35 mins to fix

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

        def update_contributors
          @curricula = Curricula.find_by_id(params[:curriculum])
          @contributor = User.find_user_by_username(params[:user])
          @does_exist = UserCurricula.does_user_exist(@curricula, @contributor.id)
          if params[:task] == 'remove'
      Severity: Minor
      Found in app/controllers/curricula/settings_controller.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 check_for_new_commits has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def check_for_new_commits
          @created_curricula.each do |c|
            @git = ::GitFunctionality::Repo.new.get_bare_repo c
            @log = @git.log
            @log.each do |l|
      Severity: Minor
      Found in app/controllers/dashboard_controller.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