felixarntz/wp-encrypt

View on GitHub

Showing 92 of 92 total issues

Avoid too many return statements within this method.
Open

                    return new WP_Error( 'private_key_cannot_create_dir', sprintf( __( 'Could not create directory <code>%s</code> for private key. Please check your filesystem permissions.', 'wp-encrypt' ), $this->path ) );
Severity: Major
Found in inc/WPENC/Core/KeyPair.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return false;
    Severity: Major
    Found in inc/WPENC/Core/Challenge.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return new WP_Error( 'no_challenge_available', sprintf( __( 'No HTTP challenge available for domain %1$s. Original response: %2$s', 'wp-encrypt' ), $domain, json_encode( $response ) ) );
      Severity: Major
      Found in inc/WPENC/Core/Challenge.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                            return $this->parse_wp_error( $result, 'new_cert_invalid_response_code', __( 'Invalid response code for new certificate request.', 'wp-encrypt' ) );
        Severity: Major
        Found in inc/WPENC/Core/CertificateManager.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return trim( $matches[1] );
          Severity: Major
          Found in inc/WPENC/Core/Certificate.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                                    return '';
            Severity: Major
            Found in inc/WPENC/Util.php - About 30 mins to fix

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

                      public static function render_status_message( $status, $context = 'site' ) {
                          $settings_page_url = self::get_admin_url( $context );
              
                          ?>
                          <p>
              Severity: Minor
              Found in inc/WPENC/App.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 get_all_domains has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                      public static function get_all_domains( $domain, $addon_domains = array() ) {
                          array_unshift( $addon_domains, $domain );
              
                          $all_domains = array();
              
              
              Severity: Minor
              Found in inc/WPENC/Core/Util.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 network_options_head has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                      public function network_options_head() {
                          global $parent_file, $wp_settings_errors;
              
                          if ( 'settings.php' === $parent_file ) {
                              if ( isset( $_GET['updated'] ) && $_GET['updated'] && get_site_transient( 'settings_errors' ) ) {
              Severity: Minor
              Found in inc/WPENC/NetworkSettingsAPI.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 revoke_certificate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                      protected function revoke_certificate( $data = array(), $network_wide = false ) {
                          $filesystem_check = $this->maybe_request_filesystem_credentials( $network_wide );
                          if ( false === $filesystem_check ) {
                              return new WP_Error( 'invalid_filesystem_credentials', __( 'Invalid or missing filesystem credentials.', 'wp-encrypt' ), 'error' );
                          }
              Severity: Minor
              Found in inc/WPENC/ActionHandler.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 get_private has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                      public function get_private( $force_refresh = false ) {
                          $filesystem = Util::get_filesystem();
              
                          if ( null === $this->private_key || $force_refresh ) {
                              $path = $this->path . '/' . self::PRIVATE_NAME;
              Severity: Minor
              Found in inc/WPENC/Core/KeyPair.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 get_public has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                      public function get_public( $force_refresh = false ) {
                          $filesystem = Util::get_filesystem();
              
                          if ( null === $this->public_key || $force_refresh ) {
                              $path = $this->path . '/' . self::PUBLIC_NAME;
              Severity: Minor
              Found in inc/WPENC/Core/KeyPair.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

              Severity
              Category
              Status
              Source
              Language