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( 'challenge_remote_check_failed', sprintf( __( 'Challenge remote check failed for domain %s.', 'wp-encrypt' ), $domain ) );
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( 'challenge_remote_check_failed', sprintf( __( 'Challenge remote check failed for domain %s.', 'wp-encrypt' ), $domain ) );
    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 new WP_Error( 'private_key_cannot_write', sprintf( __( 'Could not write private key into file <code>%s</code>. Please check your filesystem permissions.', 'wp-encrypt' ), $this->path . '/' . self::PRIVATE_NAME ) );
        Severity: Major
        Found in inc/WPENC/Core/KeyPair.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return true;
          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 true;
              Severity: Major
              Found in inc/WPENC/ActionHandler.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return new WP_Error( 'new_cert_fail', __( 'No certificates generated.', '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 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 $options[ $field ];
                    Severity: Major
                    Found in inc/WPENC/Util.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                          return (bool) $options[ $field ];
                      Severity: Major
                      Found in inc/WPENC/Util.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

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

                          Avoid too many return statements within this method.
                          Open

                                                      return $result;
                          Severity: Major
                          Found in inc/WPENC/Core/CertificateManager.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return $status;
                            Severity: Major
                            Found in inc/WPENC/Core/CertificateManager.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                                  return $result;
                              Severity: Major
                              Found in inc/WPENC/Core/CertificateManager.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                    return absint( $options[ $field ] );
                                Severity: Major
                                Found in inc/WPENC/Util.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                  return new WP_Error( 'public_key_cannot_write', sprintf( __( 'Could not write public key into file <code>%s</code>. Please check your filesystem permissions.', 'wp-encrypt' ), $this->path . '/' . self::PUBLIC_NAME ) );
                                  Severity: Major
                                  Found in inc/WPENC/Core/KeyPair.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                    return $result;
                                    Severity: Major
                                    Found in inc/WPENC/Core/CertificateManager.php - About 30 mins to fix

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                                  if ( false === $filesystem->put_contents( $this->path . '/' . self::FULLCHAIN_NAME, implode( "\n", $certs ) ) ) {
                                                      return new WP_Error( 'new_cert_cannot_write_fullchain', sprintf( __( 'Could not write certificates to file <code>%s</code>. Please check your filesystem permissions.', 'wp-encrypt' ), $this->path . '/' . self::FULLCHAIN_NAME ) );
                                                  }
                                      Severity: Minor
                                      Found in inc/WPENC/Core/Certificate.php and 1 other location - About 30 mins to fix
                                      inc/WPENC/Core/Certificate.php on lines 129..131

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 90.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Avoid too many return statements within this method.
                                      Open

                                                      return $csr;
                                      Severity: Major
                                      Found in inc/WPENC/Core/CertificateManager.php - About 30 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language