felixarntz/wp-site-identity

View on GitHub

Showing 247 of 247 total issues

Missing class import via use statement (line '352', column '14').
Open

            throw new WP_Site_Identity_Setting_Validation_Error_Exception( __( 'The color must be specified in hexadecimal format.', 'wp-site-identity' ) );

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '43', column '26').
Open

            $this->registry = new WP_Site_Identity_Standard_Settings_Field_Registry();

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '35', column '26').
Open

            $this->registry = new WP_Site_Identity_Standard_Settings_Form_Registry();

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '279', column '20').
Open

                $control = new WP_Customize_Control( $wp_customize, $setting_name, $control_args );

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '414', column '39').
Open

                    $control                   = new WP_Customize_Media_Control( $wp_customize, $setting_name, $control_args );

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '77', column '26').
Open

        $this->services  = new WP_Site_Identity_Service_Container();
Severity: Minor
Found in src/class-wp-site-identity.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '78', column '26').
Open

        $this->bootstrap = new WP_Site_Identity_Bootstrap( $this );
Severity: Minor
Found in src/class-wp-site-identity.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '38', column '24').
Open

        $this->factory = new WP_Site_Identity_Settings_Form_Factory( $this );

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '78', column '40').
Open

        $this->bootstrap_customizer    = new WP_Site_Identity_Bootstrap_Customizer( $this, $this->plugin );

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '62', column '26').
Open

            $this->registry = new WP_Site_Identity_Standard_Widget_Registry();

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Avoid too many return statements within this method.
Open

                return $this->sanitize_string_value( $value, $args );
Severity: Major
Found in src/settings/class-wp-site-identity-setting-sanitizer.php - About 30 mins to fix

    Missing class import via use statement (line '134', column '14').
    Open

                throw new WP_Site_Identity_Setting_Not_Found_Exception( sprintf( __( 'The setting with the name %s could not be found.', 'wp-site-identity' ), $name ) );

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '196', column '26').
    Open

                $this->registry = new WP_Site_Identity_Standard_Setting_Registry();

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '89', column '24').
    Open

            $this->factory = new WP_Site_Identity_Setting_Factory( $this );

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '94', column '34').
    Open

                $this->feedback_handler = new WP_Site_Identity_Setting_Feedback_Handler();

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

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

        private function get_current_tab( array $settings_forms = null ) {
            if ( null === $settings_forms ) {
                $settings_forms = $this->plugin->services()->get( 'settings_form_registry' )->get_all_forms();
            }
    
    
    Severity: Minor
    Found in src/class-wp-site-identity-bootstrap-admin-pages.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 __construct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __construct( $prefix, $group, WP_Site_Identity_Setting_Feedback_Handler $feedback_handler = null, WP_Site_Identity_Setting_Validator $validator = null, WP_Site_Identity_Setting_Sanitizer $sanitizer = null ) {
            $this->prefix = $prefix;
            $this->group  = $group;
    
            $this->factory = new WP_Site_Identity_Setting_Factory( $this );
    Severity: Minor
    Found in src/settings/class-wp-site-identity-standard-setting-registry.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_as_html has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function get_as_html( $name ) {
            switch ( $name ) {
                case 'phone_link':
                case 'email_link':
                case 'website_link':
    Severity: Minor
    Found in src/class-wp-site-identity-owner-data.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 wpsi_requirements_notice has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    function wpsi_requirements_notice() {
        $plugin_file = plugin_basename( __FILE__ );
    
        // WordPress before 4.9 didn't have a dedicated capability for this.
        if ( version_compare( $GLOBALS['wp_version'], '4.9', '<' ) ) {
    Severity: Minor
    Found in wp-site-identity.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

    Avoid unused local variables such as '$meta'.
    Open

                        if ( ! empty( $meta['multiple'] ) ) {

    UnusedLocalVariable

    Since: 0.2

    Detects when a local variable is declared and/or assigned, but not used.

    Example

    class Foo {
        public function doSomething()
        {
            $i = 5; // Unused
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

    Severity
    Category
    Status
    Source
    Language