gocodebox/lifterlms

View on GitHub
includes/forms/controllers/class.llms.controller.account.php

Summary

Maintainability
B
4 hrs
Test Coverage
A
97%

Method lost_password has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function lost_password() {

        // Invalid nonce or the form wasn't submitted.
        if ( ! llms_verify_nonce( '_lost_password_nonce', 'llms_lost_password', 'POST' ) ) {
            return null;
Severity: Minor
Found in includes/forms/controllers/class.llms.controller.account.php - About 1 hr to fix

    Function lost_password has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function lost_password() {
    
            // Invalid nonce or the form wasn't submitted.
            if ( ! llms_verify_nonce( '_lost_password_nonce', 'llms_lost_password', 'POST' ) ) {
                return null;
    Severity: Minor
    Found in includes/forms/controllers/class.llms.controller.account.php - 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

    Function update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function update() {
    
            if ( ! llms_verify_nonce( '_llms_update_person_nonce', 'llms_update_person' ) ) {
                return;
            }
    Severity: Minor
    Found in includes/forms/controllers/class.llms.controller.account.php - 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

    Avoid too many return statements within this method.
    Open

            return true;
    Severity: Major
    Found in includes/forms/controllers/class.llms.controller.account.php - About 30 mins to fix

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

          public function cancel_subscription() {
      
              // Invalid nonce or the form wasn't submitted.
              if ( ! llms_verify_nonce( '_cancel_sub_nonce', 'llms_cancel_subscription', 'POST' ) ) {
                  return;
      Severity: Minor
      Found in includes/forms/controllers/class.llms.controller.account.php - 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 validate_password_reset has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function validate_password_reset( $posted_data ) {
      
              $err = new WP_Error();
      
              $fields = LLMS_Person_Handler::get_password_reset_fields();
      Severity: Minor
      Found in includes/forms/controllers/class.llms.controller.account.php - 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

      There are no issues that match your filters.

      Category
      Status