PressLabs/gitium

View on GitHub
gitium/inc/class-gitium-menu.php

Summary

Maintainability
A
0 mins
Test Coverage

The method redirect has a boolean flag argument $success, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function redirect( $message = '', $success = false, $menu_slug = '' ) {
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method redirect() contains an exit expression.
Open

        exit;
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

ExitExpression

Since: 0.2

An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            exit(23);
        }
    }
}

Source https://phpmd.org/rules/design.html#exitexpression

Avoid excessively long variable names like $gitium_disconnect_repo. Keep variable name length under 20.
Open

        $gitium_disconnect_repo = filter_input(INPUT_POST, 'GitiumSubmitDisconnectRepository', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class Gitium_Menu {

The property $menu_slug is not named in camelCase.
Open

class Gitium_Menu {

    public $gitium_menu_slug   = 'gitium/gitium.php';
    public $commits_menu_slug  = 'gitium/gitium-commits.php';
    public $settings_menu_slug = 'gitium/gitium-settings.php';
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $submenu_slug is not named in camelCase.
Open

class Gitium_Menu {

    public $gitium_menu_slug   = 'gitium/gitium.php';
    public $commits_menu_slug  = 'gitium/gitium-commits.php';
    public $settings_menu_slug = 'gitium/gitium-settings.php';
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $commits_menu_slug is not named in camelCase.
Open

class Gitium_Menu {

    public $gitium_menu_slug   = 'gitium/gitium.php';
    public $commits_menu_slug  = 'gitium/gitium-commits.php';
    public $settings_menu_slug = 'gitium/gitium-settings.php';
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $gitium_menu_slug is not named in camelCase.
Open

class Gitium_Menu {

    public $gitium_menu_slug   = 'gitium/gitium.php';
    public $commits_menu_slug  = 'gitium/gitium-commits.php';
    public $settings_menu_slug = 'gitium/gitium-settings.php';
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $menu_slug is not named in camelCase.
Open

    public function redirect( $message = '', $success = false, $menu_slug = '' ) {
        $message_id = substr(
            md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ) . time() ), 0, 8
        );
        if ( $message ) {
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $menu_slug is not named in camelCase.
Open

    public function __construct( $menu_slug, $submenu_slug ) {
        global $git;
        $this->git = $git;

        $this->menu_slug    = $menu_slug;
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $menu_slug is not named in camelCase.
Open

    public function success_redirect( $message = '', $menu_slug = '' ) {
        $this->redirect( $message, true, $menu_slug );
    }
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The class Gitium_Menu is not named in CamelCase.
Open

class Gitium_Menu {

    public $gitium_menu_slug   = 'gitium/gitium.php';
    public $commits_menu_slug  = 'gitium/gitium-commits.php';
    public $settings_menu_slug = 'gitium/gitium-settings.php';
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The property $settings_menu_slug is not named in camelCase.
Open

class Gitium_Menu {

    public $gitium_menu_slug   = 'gitium/gitium.php';
    public $commits_menu_slug  = 'gitium/gitium-commits.php';
    public $settings_menu_slug = 'gitium/gitium-settings.php';
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $submenu_slug is not named in camelCase.
Open

    public function __construct( $menu_slug, $submenu_slug ) {
        global $git;
        $this->git = $git;

        $this->menu_slug    = $menu_slug;
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

Expected 0 spaces before closing bracket; 1 found
Open

        if ( $message ) {

Expected 0 spaces before closing bracket; 1 found
Open

        if ( ! isset( $gitium_disconnect_repo ) ) {

Method name "Gitium_Menu::show_disconnect_repository_button" is not in camel caps format
Open

    protected function show_disconnect_repository_button() {

Expected 0 spaces between argument "$menu_slug" and closing bracket; 1 found
Open

    public function redirect( $message = '', $success = false, $menu_slug = '' ) {

Method name "Gitium_Menu::success_redirect" is not in camel caps format
Open

    public function success_redirect( $message = '', $menu_slug = '' ) {

Expected 0 spaces between opening bracket and argument "$message"; 1 found
Open

    public function success_redirect( $message = '', $menu_slug = '' ) {

Expected 0 spaces before closing bracket; 1 found
Open

        if ( isset( $get_message ) && $get_message ) {

Expected 0 spaces between opening bracket and argument "$message"; 1 found
Open

    public function redirect( $message = '', $success = false, $menu_slug = '' ) {

Expected 0 spaces before closing bracket; 1 found
Open

        if ( ! $this->git->remove_remote() ) {

Method name "Gitium_Menu::disconnect_repository" is not in camel caps format
Open

    public function disconnect_repository() {

Expected 0 spaces before closing bracket; 1 found
Open

        if ( '' === $menu_slug ) { $menu_slug = $this->menu_slug; }

Expected 0 spaces between argument "$submenu_slug" and closing bracket; 1 found
Open

    public function __construct( $menu_slug, $submenu_slug ) {

Expected 0 spaces between argument "$menu_slug" and closing bracket; 1 found
Open

    public function success_redirect( $message = '', $menu_slug = '' ) {

Method name "Gitium_Menu::show_message" is not in camel caps format
Open

    public function show_message() {

Expected 0 spaces between opening bracket and argument "$menu_slug"; 1 found
Open

    public function __construct( $menu_slug, $submenu_slug ) {

Expected 0 spaces before closing bracket; 2 found
Open

            if ( $message  ) : ?>

Opening brace of a class must be on the line after the definition
Open

class Gitium_Menu {

Only one argument is allowed per line in a multi-line function call
Open

            md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ) . time() ), 0, 8

Only one argument is allowed per line in a multi-line function call
Open

            md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ) . time() ), 0, 8

Spaces must be used to indent lines; tabs are not allowed
Open

    public $menu_slug;

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

                'message' => $message_id,

Spaces must be used to indent lines; tabs are not allowed
Open

                'success' => $success,

Spaces must be used to indent lines; tabs are not allowed
Open

        wp_safe_redirect( $url );

Spaces must be used to indent lines; tabs are not allowed
Open

    public function show_message() {

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->menu_slug    = $menu_slug;

Spaces must be used to indent lines; tabs are not allowed
Open

            ),

Spaces must be used to indent lines; tabs are not allowed
Open

            $url

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        if ( ! isset( $gitium_disconnect_repo ) ) {

Spaces must be used to indent lines; tabs are not allowed
Open

        gitium_uninstall_hook();

Line exceeds 120 characters; contains 121 characters
Open

        $this->success_redirect( __('You are now disconnected from the repository. New key pair generated.', 'gitium') );

Spaces must be used to indent lines; tabs are not allowed
Open

            if ( $message  ) : ?>

Spaces must be used to indent lines; tabs are not allowed
Open

            <?php endif;

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        $url = esc_url_raw( add_query_arg(

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        ?>

Spaces must be used to indent lines; tabs are not allowed
Open

    public $gitium_menu_slug   = 'gitium/gitium.php';

Spaces must be used to indent lines; tabs are not allowed
Open

    public function redirect( $message = '', $success = false, $menu_slug = '' ) {

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        exit;

Spaces must be used to indent lines; tabs are not allowed
Open

        if ( ! $this->git->remove_remote() ) {

Spaces must be used to indent lines; tabs are not allowed
Open

            <?php

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        <?php

Spaces must be used to indent lines; tabs are not allowed
Open

        $message_id = substr(

Spaces must be used to indent lines; tabs are not allowed
Open

        if ( $message ) {

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        check_admin_referer( 'gitium-admin' );

Spaces must be used to indent lines; tabs are not allowed
Open

            <input type="submit" name="GitiumSubmitDisconnectRepository" value='<?php _e( 'Disconnect from repo', 'gitium' ); ?>' class="button secondary" onclick="return confirm('<?php _e( 'Are you sure you want to disconnect from the remote repository?', 'gitium' ); ?>')"/>&nbsp;

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    public $submenu_slug;

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->git = $git;

Spaces must be used to indent lines; tabs are not allowed
Open

        ) );

Spaces must be used to indent lines; tabs are not allowed
Open

        if ( isset( $get_message ) && $get_message ) {

Spaces must be used to indent lines; tabs are not allowed
Open

    public $settings_menu_slug = 'gitium/gitium-settings.php';

Spaces must be used to indent lines; tabs are not allowed
Open

    public function success_redirect( $message = '', $menu_slug = '' ) {

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->redirect( $message, true, $menu_slug );

Spaces must be used to indent lines; tabs are not allowed
Open

            return;

Spaces must be used to indent lines; tabs are not allowed
Open

                wp_nonce_field( 'gitium-admin' );

Spaces must be used to indent lines; tabs are not allowed
Open

    public $commits_menu_slug  = 'gitium/gitium-commits.php';

Spaces must be used to indent lines; tabs are not allowed
Open

            $message = get_transient( 'message_'. $get_message );

Spaces must be used to indent lines; tabs are not allowed
Open

    public function __construct( $menu_slug, $submenu_slug ) {

Spaces must be used to indent lines; tabs are not allowed
Open

        global $git;

Spaces must be used to indent lines; tabs are not allowed
Open

            set_transient( 'message_' . $message_id, $message, 900 );

Spaces must be used to indent lines; tabs are not allowed
Open

          ?>

Line exceeds 120 characters; contains 282 characters
Open

            <input type="submit" name="GitiumSubmitDisconnectRepository" value='<?php _e( 'Disconnect from repo', 'gitium' ); ?>' class="button secondary" onclick="return confirm('<?php _e( 'Are you sure you want to disconnect from the remote repository?', 'gitium' ); ?>')"/>&nbsp;

Spaces must be used to indent lines; tabs are not allowed
Open

        $url = network_admin_url( 'admin.php?page=' . $menu_slug );

Spaces must be used to indent lines; tabs are not allowed
Open

            $type    = ( isset( $get_success ) && $get_success == 1 ) ? 'updated' : 'error';

Spaces must be used to indent lines; tabs are not allowed
Open

        </form>

Spaces must be used to indent lines; tabs are not allowed
Open

            md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ) . time() ), 0, 8

Spaces must be used to indent lines; tabs are not allowed
Open

                <div class="<?php echo esc_attr( $type ); ?>"><p><?php echo esc_html( $message ); ?></p></div>

Spaces must be used to indent lines; tabs are not allowed
Open

    public $git = null;

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->submenu_slug = $submenu_slug;

Spaces must be used to indent lines; tabs are not allowed
Open

            array(

Spaces must be used to indent lines; tabs are not allowed
Open

            $this->redirect( __('Could not remove remote.', 'gitium') );

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->success_redirect( __('You are now disconnected from the repository. New key pair generated.', 'gitium') );

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        $get_success = filter_input(INPUT_GET, 'success', FILTER_SANITIZE_FULL_SPECIAL_CHARS);

Spaces must be used to indent lines; tabs are not allowed
Open

    protected function show_disconnect_repository_button() {

Spaces must be used to indent lines; tabs are not allowed
Open

        $get_message = filter_input(INPUT_GET, 'message', FILTER_SANITIZE_FULL_SPECIAL_CHARS);

Spaces must be used to indent lines; tabs are not allowed
Open

        );

Spaces must be used to indent lines; tabs are not allowed
Open

        if ( '' === $menu_slug ) { $menu_slug = $this->menu_slug; }

Spaces must be used to indent lines; tabs are not allowed
Open

    public function disconnect_repository() {

Line exceeds 120 characters; contains 131 characters
Open

        $gitium_disconnect_repo = filter_input(INPUT_POST, 'GitiumSubmitDisconnectRepository', FILTER_SANITIZE_FULL_SPECIAL_CHARS);

Spaces must be used to indent lines; tabs are not allowed
Open

        <form name="gitium_form_disconnect" id="gitium_form_disconnect" action="" method="POST">

Class name "Gitium_Menu" is not in camel caps format
Open

class Gitium_Menu {

Space after opening parenthesis of function call prohibited
Open

            set_transient( 'message_' . $message_id, $message, 900 );

Expected 0 spaces after opening bracket; 1 found
Open

        if ( '' === $menu_slug ) { $menu_slug = $this->menu_slug; }

Closing brace must be on a line by itself
Open

        if ( '' === $menu_slug ) { $menu_slug = $this->menu_slug; }

Expected 0 spaces after opening bracket; 1 found
Open

        if ( ! $this->git->remove_remote() ) {

Space after opening parenthesis of function call prohibited
Open

            $this->redirect( __('Could not remove remote.', 'gitium') );

Expected 0 spaces after opening bracket; 1 found
Open

            if ( $message  ) : ?>

Space after opening parenthesis of function call prohibited
Open

            <input type="submit" name="GitiumSubmitDisconnectRepository" value='<?php _e( 'Disconnect from repo', 'gitium' ); ?>' class="button secondary" onclick="return confirm('<?php _e( 'Are you sure you want to disconnect from the remote repository?', 'gitium' ); ?>')"/>&nbsp;

Space after opening parenthesis of function call prohibited
Open

            md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ) . time() ), 0, 8

Expected 0 spaces after opening bracket; 1 found
Open

        if ( $message ) {

Opening brace should be on a new line
Open

    public function disconnect_repository() {

Expected 0 spaces before closing bracket; 1 found
Open

            $type    = ( isset( $get_success ) && $get_success == 1 ) ? 'updated' : 'error';

Expected 0 spaces before closing bracket; 1 found
Open

                <div class="<?php echo esc_attr( $type ); ?>"><p><?php echo esc_html( $message ); ?></p></div>

Expected 0 spaces before closing bracket; 1 found
Open

            md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ) . time() ), 0, 8

Space after opening parenthesis of function call prohibited
Open

        $url = esc_url_raw( add_query_arg(

Expected 0 spaces after opening bracket; 1 found
Open

        if ( ! isset( $gitium_disconnect_repo ) ) {

Space after opening parenthesis of function call prohibited
Open

                <div class="<?php echo esc_attr( $type ); ?>"><p><?php echo esc_html( $message ); ?></p></div>

Expected 0 spaces before closing bracket; 1 found
Open

            <input type="submit" name="GitiumSubmitDisconnectRepository" value='<?php _e( 'Disconnect from repo', 'gitium' ); ?>' class="button secondary" onclick="return confirm('<?php _e( 'Are you sure you want to disconnect from the remote repository?', 'gitium' ); ?>')"/>&nbsp;

Space after opening parenthesis of function call prohibited
Open

            <input type="submit" name="GitiumSubmitDisconnectRepository" value='<?php _e( 'Disconnect from repo', 'gitium' ); ?>' class="button secondary" onclick="return confirm('<?php _e( 'Are you sure you want to disconnect from the remote repository?', 'gitium' ); ?>')"/>&nbsp;

Expected 0 spaces before closing bracket; 1 found
Open

            <input type="submit" name="GitiumSubmitDisconnectRepository" value='<?php _e( 'Disconnect from repo', 'gitium' ); ?>' class="button secondary" onclick="return confirm('<?php _e( 'Are you sure you want to disconnect from the remote repository?', 'gitium' ); ?>')"/>&nbsp;

Space after opening parenthesis of function call prohibited
Open

            md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ) . time() ), 0, 8

Expected 0 spaces before closing bracket; 1 found
Open

        $url = network_admin_url( 'admin.php?page=' . $menu_slug );

Space after opening parenthesis of function call prohibited
Open

        $this->redirect( $message, true, $menu_slug );

Expected 0 spaces before closing bracket; 1 found
Open

        $this->redirect( $message, true, $menu_slug );

Line indented incorrectly; expected 12 spaces, found 10
Open

          ?>

Space after opening parenthesis of function call prohibited
Open

        $this->success_redirect( __('You are now disconnected from the repository. New key pair generated.', 'gitium') );

Space after opening parenthesis of function call prohibited
Open

                <div class="<?php echo esc_attr( $type ); ?>"><p><?php echo esc_html( $message ); ?></p></div>

Expected 0 spaces before closing bracket; 1 found
Open

            set_transient( 'message_' . $message_id, $message, 900 );

Expected 0 spaces before closing bracket; 1 found
Open

        check_admin_referer( 'gitium-admin' );

Space after opening parenthesis of function call prohibited
Open

        wp_safe_redirect( $url );

Expected 0 spaces before closing bracket; 1 found
Open

        if ( isset( $get_message ) && $get_message ) {

Expected 0 spaces before closing bracket; 1 found
Open

                wp_nonce_field( 'gitium-admin' );

Expected 0 spaces before closing bracket; 1 found
Open

            $this->redirect( __('Could not remove remote.', 'gitium') );

Opening brace should be on a new line
Open

    public function redirect( $message = '', $success = false, $menu_slug = '' ) {

Newline required after opening brace
Open

        if ( '' === $menu_slug ) { $menu_slug = $this->menu_slug; }

Space after opening parenthesis of function call prohibited
Open

        $url = network_admin_url( 'admin.php?page=' . $menu_slug );

Expected 0 spaces before closing bracket; 1 found
Open

        $url = esc_url_raw( add_query_arg(

Expected 0 spaces before closing bracket; 1 found
Open

        wp_safe_redirect( $url );

Space after opening parenthesis of function call prohibited
Open

        check_admin_referer( 'gitium-admin' );

Space after opening parenthesis of function call prohibited
Open

        if ( isset( $get_message ) && $get_message ) {

Space after opening parenthesis of function call prohibited
Open

            $message = get_transient( 'message_'. $get_message );

Opening brace should be on a new line
Open

    protected function show_disconnect_repository_button() {

Space after opening parenthesis of function call prohibited
Open

                wp_nonce_field( 'gitium-admin' );

Opening brace should be on a new line
Open

    public function success_redirect( $message = '', $menu_slug = '' ) {

Expected 0 spaces before closing bracket; 1 found
Open

        if ( ! isset( $gitium_disconnect_repo ) ) {

Opening brace should be on a new line
Open

    public function show_message() {

Expected 0 spaces before closing bracket; 1 found
Open

                <div class="<?php echo esc_attr( $type ); ?>"><p><?php echo esc_html( $message ); ?></p></div>

Expected 0 spaces before closing bracket; 1 found
Open

        $this->success_redirect( __('You are now disconnected from the repository. New key pair generated.', 'gitium') );

Expected 0 spaces after opening bracket; 1 found
Open

        if ( isset( $get_message ) && $get_message ) {

Expected 0 spaces before closing bracket; 1 found
Open

            $message = get_transient( 'message_'. $get_message );

Expected 0 spaces before closing bracket; 1 found
Open

            md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ) . time() ), 0, 8

Space after opening parenthesis of function call prohibited
Open

        if ( ! isset( $gitium_disconnect_repo ) ) {

Space after opening parenthesis of function call prohibited
Open

            $type    = ( isset( $get_success ) && $get_success == 1 ) ? 'updated' : 'error';

Opening brace should be on a new line
Open

    public function __construct( $menu_slug, $submenu_slug ) {

The variable $message_id is not named in camelCase.
Open

    public function redirect( $message = '', $success = false, $menu_slug = '' ) {
        $message_id = substr(
            md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ) . time() ), 0, 8
        );
        if ( $message ) {
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $get_success is not named in camelCase.
Open

    public function show_message() {
        $get_message = filter_input(INPUT_GET, 'message', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        $get_success = filter_input(INPUT_GET, 'success', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        if ( isset( $get_message ) && $get_message ) {
            $type    = ( isset( $get_success ) && $get_success == 1 ) ? 'updated' : 'error';
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $menu_slug is not named in camelCase.
Open

    public function redirect( $message = '', $success = false, $menu_slug = '' ) {
        $message_id = substr(
            md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ) . time() ), 0, 8
        );
        if ( $message ) {
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $get_message is not named in camelCase.
Open

    public function show_message() {
        $get_message = filter_input(INPUT_GET, 'message', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        $get_success = filter_input(INPUT_GET, 'success', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        if ( isset( $get_message ) && $get_message ) {
            $type    = ( isset( $get_success ) && $get_success == 1 ) ? 'updated' : 'error';
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $get_success is not named in camelCase.
Open

    public function show_message() {
        $get_message = filter_input(INPUT_GET, 'message', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        $get_success = filter_input(INPUT_GET, 'success', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        if ( isset( $get_message ) && $get_message ) {
            $type    = ( isset( $get_success ) && $get_success == 1 ) ? 'updated' : 'error';
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $get_message is not named in camelCase.
Open

    public function show_message() {
        $get_message = filter_input(INPUT_GET, 'message', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        $get_success = filter_input(INPUT_GET, 'success', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        if ( isset( $get_message ) && $get_message ) {
            $type    = ( isset( $get_success ) && $get_success == 1 ) ? 'updated' : 'error';
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $get_success is not named in camelCase.
Open

    public function show_message() {
        $get_message = filter_input(INPUT_GET, 'message', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        $get_success = filter_input(INPUT_GET, 'success', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        if ( isset( $get_message ) && $get_message ) {
            $type    = ( isset( $get_success ) && $get_success == 1 ) ? 'updated' : 'error';
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $menu_slug is not named in camelCase.
Open

    public function redirect( $message = '', $success = false, $menu_slug = '' ) {
        $message_id = substr(
            md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ) . time() ), 0, 8
        );
        if ( $message ) {
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $get_message is not named in camelCase.
Open

    public function show_message() {
        $get_message = filter_input(INPUT_GET, 'message', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        $get_success = filter_input(INPUT_GET, 'success', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        if ( isset( $get_message ) && $get_message ) {
            $type    = ( isset( $get_success ) && $get_success == 1 ) ? 'updated' : 'error';
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $submenu_slug is not named in camelCase.
Open

    public function __construct( $menu_slug, $submenu_slug ) {
        global $git;
        $this->git = $git;

        $this->menu_slug    = $menu_slug;
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $get_message is not named in camelCase.
Open

    public function show_message() {
        $get_message = filter_input(INPUT_GET, 'message', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        $get_success = filter_input(INPUT_GET, 'success', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        if ( isset( $get_message ) && $get_message ) {
            $type    = ( isset( $get_success ) && $get_success == 1 ) ? 'updated' : 'error';
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $message_id is not named in camelCase.
Open

    public function redirect( $message = '', $success = false, $menu_slug = '' ) {
        $message_id = substr(
            md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ) . time() ), 0, 8
        );
        if ( $message ) {
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $menu_slug is not named in camelCase.
Open

    public function __construct( $menu_slug, $submenu_slug ) {
        global $git;
        $this->git = $git;

        $this->menu_slug    = $menu_slug;
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $message_id is not named in camelCase.
Open

    public function redirect( $message = '', $success = false, $menu_slug = '' ) {
        $message_id = substr(
            md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ) . time() ), 0, 8
        );
        if ( $message ) {
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $gitium_disconnect_repo is not named in camelCase.
Open

    public function disconnect_repository() {
        $gitium_disconnect_repo = filter_input(INPUT_POST, 'GitiumSubmitDisconnectRepository', FILTER_SANITIZE_FULL_SPECIAL_CHARS);

        if ( ! isset( $gitium_disconnect_repo ) ) {
            return;
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $gitium_disconnect_repo is not named in camelCase.
Open

    public function disconnect_repository() {
        $gitium_disconnect_repo = filter_input(INPUT_POST, 'GitiumSubmitDisconnectRepository', FILTER_SANITIZE_FULL_SPECIAL_CHARS);

        if ( ! isset( $gitium_disconnect_repo ) ) {
            return;
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $menu_slug is not named in camelCase.
Open

    public function redirect( $message = '', $success = false, $menu_slug = '' ) {
        $message_id = substr(
            md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ) . time() ), 0, 8
        );
        if ( $message ) {
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $menu_slug is not named in camelCase.
Open

    public function success_redirect( $message = '', $menu_slug = '' ) {
        $this->redirect( $message, true, $menu_slug );
    }
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The method success_redirect is not named in camelCase.
Open

    public function success_redirect( $message = '', $menu_slug = '' ) {
        $this->redirect( $message, true, $menu_slug );
    }
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method disconnect_repository is not named in camelCase.
Open

    public function disconnect_repository() {
        $gitium_disconnect_repo = filter_input(INPUT_POST, 'GitiumSubmitDisconnectRepository', FILTER_SANITIZE_FULL_SPECIAL_CHARS);

        if ( ! isset( $gitium_disconnect_repo ) ) {
            return;
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method show_message is not named in camelCase.
Open

    public function show_message() {
        $get_message = filter_input(INPUT_GET, 'message', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        $get_success = filter_input(INPUT_GET, 'success', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        if ( isset( $get_message ) && $get_message ) {
            $type    = ( isset( $get_success ) && $get_success == 1 ) ? 'updated' : 'error';
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method show_disconnect_repository_button is not named in camelCase.
Open

    protected function show_disconnect_repository_button() {
        ?>
        <form name="gitium_form_disconnect" id="gitium_form_disconnect" action="" method="POST">
            <?php
                wp_nonce_field( 'gitium-admin' );
Severity: Minor
Found in gitium/inc/class-gitium-menu.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status