felixarntz/wp-encrypt

View on GitHub

Showing 86 of 92 total issues

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 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_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 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

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

Severity
Category
Status
Source
Language