PressLabs/gitium

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

Summary

Maintainability
A
35 mins
Test Coverage

Function is_git_version has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function is_git_version() {
        $git_version = get_transient( 'gitium_git_version' );

        if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {
            global $git;
Severity: Minor
Found in gitium/inc/class-gitium-requirements.php - About 35 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

The method is_php_version uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                return array( false, "The PHP version is `$php_version` and is not greater or equal to " . GITIUM_MIN_PHP_VER );
            }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

The method can_exec_ssh_git_file uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            return array( false, "The `$filepath` file is not executable" );
        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

The method is_proc_open uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            return array( true, 'The function `proc_open` is enabled!' );
        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

The method is_php_version uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $php_version = phpversion();
            if ( GITIUM_MIN_PHP_VER <= substr( $php_version, 0, 3 ) ) {
                return array( true, "The PHP version is `$php_version`." );
            } else {

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

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

class Gitium_Requirements {

The class Gitium_Requirements is not named in CamelCase.
Open

class Gitium_Requirements {

    private $req = array();
    private $msg = array();

CamelCaseClassName

Since: 0.2

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

Example

class class_name {
}

Source

Method name "Gitium_Requirements::_check_req" is not in camel caps format
Open

    private function _check_req() {

Expected 0 spaces before closing bracket; 1 found
Open

        foreach ( $this->req as $key => $value ) {

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

class Gitium_Requirements {

Space found after opening bracket of FOREACH loop
Open

        foreach ( $this->req as $key => $value ) {

Method name "Gitium_Requirements::is_proc_open" is not in camel caps format
Open

    private function is_proc_open() {

Method name "Gitium_Requirements::admin_notices" is not in camel caps format
Open

    public function admin_notices() {

Space found before closing bracket of FOREACH loop
Open

        foreach ( $this->req as $key => $value ) {

Space found before closing bracket of FOREACH loop
Open

        foreach ( $requirements as $req ) :

Method name "_check_req" should not be prefixed with an underscore to indicate visibility
Open

    private function _check_req() {

Space found after opening bracket of FOREACH loop
Open

        foreach ( $requirements as $req ) :

Expected 0 spaces before closing bracket; 1 found
Open

        foreach ( $requirements as $req ) :

Method name "Gitium_Requirements::get_status" is not in camel caps format
Open

    public function get_status() {

Expected 0 spaces before closing bracket; 1 found
Open

            if ( empty( $git_version ) ) {

Expected 0 spaces before closing bracket; 1 found
Open

        if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {

Expected 0 spaces before closing bracket; 1 found
Open

        } else if ( is_executable( $filepath ) ) {

Expected 0 spaces before closing bracket; 1 found
Open

        if ( ! function_exists( 'is_executable' ) ) {

Method name "Gitium_Requirements::is_git_version" is not in camel caps format
Open

    private function is_git_version() {

Expected 0 spaces before closing bracket; 1 found
Open

            if ( false === $value ) {

Expected 0 spaces before closing bracket; 1 found
Open

            } else if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {

Method name "Gitium_Requirements::can_exec_ssh_git_file" is not in camel caps format
Open

    private function can_exec_ssh_git_file() {

Method name "Gitium_Requirements::is_php_version" is not in camel caps format
Open

    private function is_php_version() {

Expected 0 spaces before closing bracket; 1 found
Open

        if ( ! function_exists( 'phpversion' ) ) {

Expected 0 spaces before closing bracket; 1 found
Open

        if ( ! current_user_can( GITIUM_MANAGE_OPTIONS_CAPABILITY ) ) {

Expected 0 spaces before closing bracket; 1 found
Open

            if ( false === $req ) :

Expected 0 spaces before closing bracket; 1 found
Open

        if ( ! function_exists( 'proc_open' ) ) {

Expected 0 spaces before closing bracket; 1 found
Open

            if ( GITIUM_MIN_PHP_VER <= substr( $php_version, 0, 3 ) ) {

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

    private $msg = array();

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

        list($this->req['is_git_version'],       $this->msg['is_git_version']       ) = $this->is_git_version();

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

     * PHP min version

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

        if ( ! current_user_can( GITIUM_MANAGE_OPTIONS_CAPABILITY ) ) {

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

     * Gitium requires:

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

        $git_version = get_transient( 'gitium_git_version' );

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

        if ( ! function_exists( 'proc_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

        list($this->req['can_exec_ssh_git_file'],$this->msg['can_exec_ssh_git_file']) = $this->can_exec_ssh_git_file();

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

        foreach ( $requirements as $req ) :

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

            if ( false === $req ) :

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

            }

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

     * git min version

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

        list($this->req['is_php_verion'],        $this->msg['is_php_verion']        ) = $this->is_php_version();

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

            if ( false === $value ) {

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

            global $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

        }

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

    }

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

        $requirements = $this->req;

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

            }

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

    private function is_git_version() {

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

            $php_version = phpversion();

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

        list($this->req['is_proc_open'],         $this->msg['is_proc_open']         ) = $this->is_proc_open();

Line exceeds 120 characters; contains 130 characters
Open

                return array( false, "The git version is `$git_version` and must be greater than `" . GITIUM_MIN_GIT_VER . "`!" );

Line exceeds 120 characters; contains 128 characters
Open

                return array( false, "The PHP version is `$php_version` and is not greater or equal to " . GITIUM_MIN_PHP_VER );

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

     * the function proc_open available

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

        $this->_check_req();

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

        add_action( GITIUM_ADMIN_NOTICES_ACTION, array( $this, 'admin_notices' ) );

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

    private function _check_req() {

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

        } else {

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

        return $this->req;

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

        }

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

            endif;

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

            return array( true, 'The function `proc_open` is enabled!' );

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

        $filepath = dirname( __FILE__ ) . '/ssh-git';

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

    private $req = array();

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

        foreach ( $this->req as $key => $value ) {

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

    private function is_php_version() {

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

            return array( false, "The `$filepath` file is not executable" );

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

    public function __construct() {

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

    }

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

                return array( false, "The PHP version is `$php_version` and is not greater or equal to " . GITIUM_MIN_PHP_VER );

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

                return false;

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

        return true;

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 ( empty( $git_version ) ) {

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

                return array( false, "The git version is `$git_version` and must be greater than `" . GITIUM_MIN_GIT_VER . "`!" );

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

        }

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

            return array( true, "The `$filepath` file can be executed!" );

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

     * can exec the file inc/ssh-git

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

        endforeach;

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

                echo "<div class='error-nag error'><p>Gitium Requirement: {$this->msg[$key]}</p></div>";

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

    }

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

            set_transient( 'gitium_git_version', $git_version );

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

        if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {

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

                return array( false, 'There is no git installed on this server.' );

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

            } else if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {

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

        return array( true, "The git version is `$git_version`." );

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

            return array( false, 'The function `proc_open` is disabled!' );

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 ( GITIUM_MIN_PHP_VER <= substr( $php_version, 0, 3 ) ) {

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

            } else {

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

        } else if ( is_executable( $filepath ) ) {

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

            $git_version = $git->get_version();

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

    private function can_exec_ssh_git_file() {

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

    public function admin_notices() {

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

        if ( ! function_exists( 'is_executable' ) ) {

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

    public function get_status() {

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

    private function is_proc_open() {

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

        if ( ! function_exists( 'phpversion' ) ) {

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

            return array( false, 'The function `is_executable` is disabled!' );

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

        } else {

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

        } else {

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

            return array( false, 'The function `phpversion` is disabled!' );

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

                return array( true, "The PHP version is `$php_version`." );

Expected 0 spaces before closing bracket; 1 found
Open

        add_action( GITIUM_ADMIN_NOTICES_ACTION, array( $this, 'admin_notices' ) );

Opening brace should be on a new line
Open

    public function admin_notices() {

Expected 0 spaces after opening bracket; 1 found
Open

        foreach ( $this->req as $key => $value ) {

Usage of ELSE IF is discouraged; use ELSEIF instead
Open

            } else if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {

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

class Gitium_Requirements {

Expected 0 spaces before closing bracket; 1 found
Open

            set_transient( 'gitium_git_version', $git_version );

Expected 0 spaces before closing bracket; 1 found
Open

            } else if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {

Expected 0 spaces after opening bracket; 1 found
Open

        if ( ! function_exists( 'proc_open' ) ) {

Expected 0 spaces after opening bracket; 1 found
Open

        if ( ! current_user_can( GITIUM_MANAGE_OPTIONS_CAPABILITY ) ) {

Expected 0 spaces before closing bracket; 1 found
Open

        if ( ! current_user_can( GITIUM_MANAGE_OPTIONS_CAPABILITY ) ) {

Expected 0 spaces after opening bracket; 1 found
Open

        if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {

Expected 0 spaces before closing bracket; 1 found
Open

        if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {

Opening brace should be on a new line
Open

    private function _check_req() {

Expected 0 spaces after opening bracket; 1 found
Open

        foreach ( $requirements as $req ) :

Expected 0 spaces after opening bracket; 1 found
Open

            if ( GITIUM_MIN_PHP_VER <= substr( $php_version, 0, 3 ) ) {

Opening brace should be on a new line
Open

    public function __construct() {

Space after opening parenthesis of function call prohibited
Open

        add_action( GITIUM_ADMIN_NOTICES_ACTION, array( $this, 'admin_notices' ) );

Expected 0 spaces after opening bracket; 1 found
Open

            if ( false === $value ) {

Expected 0 spaces before closing bracket; 1 found
Open

        if ( ! function_exists( 'phpversion' ) ) {

Usage of ELSE IF is discouraged; use ELSEIF instead
Open

        } else if ( is_executable( $filepath ) ) {

Space after opening parenthesis of function call prohibited
Open

            set_transient( 'gitium_git_version', $git_version );

Expected 0 spaces before closing bracket; 1 found
Open

        if ( ! function_exists( 'proc_open' ) ) {

Expected 0 spaces after opening bracket; 1 found
Open

        if ( ! function_exists( 'phpversion' ) ) {

Space after opening parenthesis of function call prohibited
Open

            } else if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {

Space after opening parenthesis of function call prohibited
Open

        if ( ! function_exists( 'phpversion' ) ) {

Expected 0 spaces before closing bracket; 1 found
Open

            if ( GITIUM_MIN_PHP_VER <= substr( $php_version, 0, 3 ) ) {

Space after opening parenthesis of function call prohibited
Open

        if ( ! current_user_can( GITIUM_MANAGE_OPTIONS_CAPABILITY ) ) {

Opening brace should be on a new line
Open

    public function get_status() {

Expected 0 spaces before closing bracket; 1 found
Open

            if ( empty( $git_version ) ) {

Opening brace should be on a new line
Open

    private function can_exec_ssh_git_file() {

Space after opening parenthesis of function call prohibited
Open

        } else if ( is_executable( $filepath ) ) {

Expected 0 spaces before closing bracket; 1 found
Open

        $git_version = get_transient( 'gitium_git_version' );

Expected 0 spaces after opening bracket; 1 found
Open

            } else if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {

Expected 0 spaces before closing bracket; 1 found
Open

        if ( ! function_exists( 'is_executable' ) ) {

Space after opening parenthesis of function call prohibited
Open

        $filepath = dirname( __FILE__ ) . '/ssh-git';

Space after opening parenthesis of function call prohibited
Open

        $git_version = get_transient( 'gitium_git_version' );

Space after opening parenthesis of function call prohibited
Open

        if ( ! function_exists( 'proc_open' ) ) {

Expected 0 spaces before closing bracket; 1 found
Open

        } else if ( is_executable( $filepath ) ) {

Expected 0 spaces after opening bracket; 1 found
Open

            if ( false === $req ) :

Space after opening parenthesis of function call prohibited
Open

        if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {

Expected 0 spaces after opening bracket; 1 found
Open

            if ( empty( $git_version ) ) {

Space after opening parenthesis of function call prohibited
Open

            if ( empty( $git_version ) ) {

Space after opening parenthesis of function call prohibited
Open

            if ( GITIUM_MIN_PHP_VER <= substr( $php_version, 0, 3 ) ) {

Opening brace should be on a new line
Open

    private function is_git_version() {

Opening brace should be on a new line
Open

    private function is_proc_open() {

Opening brace should be on a new line
Open

    private function is_php_version() {

Expected 0 spaces after opening bracket; 1 found
Open

        if ( ! function_exists( 'is_executable' ) ) {

Expected 0 spaces before closing bracket; 1 found
Open

        $filepath = dirname( __FILE__ ) . '/ssh-git';

Space after opening parenthesis of function call prohibited
Open

        if ( ! function_exists( 'is_executable' ) ) {

Expected 0 spaces after opening bracket; 1 found
Open

        } else if ( is_executable( $filepath ) ) {

The variable $git_version is not named in camelCase.
Open

    private function is_git_version() {
        $git_version = get_transient( 'gitium_git_version' );

        if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {
            global $git;

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 $git_version is not named in camelCase.
Open

    private function is_git_version() {
        $git_version = get_transient( 'gitium_git_version' );

        if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {
            global $git;

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 $php_version is not named in camelCase.
Open

    private function is_php_version() {
        if ( ! function_exists( 'phpversion' ) ) {
            return array( false, 'The function `phpversion` is disabled!' );
        } else {
            $php_version = phpversion();

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 $php_version is not named in camelCase.
Open

    private function is_php_version() {
        if ( ! function_exists( 'phpversion' ) ) {
            return array( false, 'The function `phpversion` is disabled!' );
        } else {
            $php_version = phpversion();

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 $git_version is not named in camelCase.
Open

    private function is_git_version() {
        $git_version = get_transient( 'gitium_git_version' );

        if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {
            global $git;

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 $git_version is not named in camelCase.
Open

    private function is_git_version() {
        $git_version = get_transient( 'gitium_git_version' );

        if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {
            global $git;

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 $git_version is not named in camelCase.
Open

    private function is_git_version() {
        $git_version = get_transient( 'gitium_git_version' );

        if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {
            global $git;

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 $git_version is not named in camelCase.
Open

    private function is_git_version() {
        $git_version = get_transient( 'gitium_git_version' );

        if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {
            global $git;

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 $git_version is not named in camelCase.
Open

    private function is_git_version() {
        $git_version = get_transient( 'gitium_git_version' );

        if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {
            global $git;

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 $php_version is not named in camelCase.
Open

    private function is_php_version() {
        if ( ! function_exists( 'phpversion' ) ) {
            return array( false, 'The function `phpversion` is disabled!' );
        } else {
            $php_version = phpversion();

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 $git_version is not named in camelCase.
Open

    private function is_git_version() {
        $git_version = get_transient( 'gitium_git_version' );

        if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {
            global $git;

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 $php_version is not named in camelCase.
Open

    private function is_php_version() {
        if ( ! function_exists( 'phpversion' ) ) {
            return array( false, 'The function `phpversion` is disabled!' );
        } else {
            $php_version = phpversion();

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 is_proc_open is not named in camelCase.
Open

    private function is_proc_open() {
        if ( ! function_exists( 'proc_open' ) ) {
            return array( false, 'The function `proc_open` is disabled!' );
        } else {
            return array( true, 'The function `proc_open` is enabled!' );

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 is_git_version is not named in camelCase.
Open

    private function is_git_version() {
        $git_version = get_transient( 'gitium_git_version' );

        if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {
            global $git;

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 can_exec_ssh_git_file is not named in camelCase.
Open

    private function can_exec_ssh_git_file() {
        $filepath = dirname( __FILE__ ) . '/ssh-git';

        if ( ! function_exists( 'is_executable' ) ) {
            return array( false, 'The function `is_executable` is disabled!' );

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 admin_notices is not named in camelCase.
Open

    public function admin_notices() {
        if ( ! current_user_can( GITIUM_MANAGE_OPTIONS_CAPABILITY ) ) {
            return;
        }

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 get_status is not named in camelCase.
Open

    public function get_status() {
        $requirements = $this->req;

        foreach ( $requirements as $req ) :
            if ( false === $req ) :

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 is_php_version is not named in camelCase.
Open

    private function is_php_version() {
        if ( ! function_exists( 'phpversion' ) ) {
            return array( false, 'The function `phpversion` is disabled!' );
        } else {
            $php_version = phpversion();

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 _check_req is not named in camelCase.
Open

    private function _check_req() {
        list($this->req['is_git_version'],       $this->msg['is_git_version']       ) = $this->is_git_version();
        list($this->req['is_proc_open'],         $this->msg['is_proc_open']         ) = $this->is_proc_open();
        list($this->req['is_php_verion'],        $this->msg['is_php_verion']        ) = $this->is_php_version();
        list($this->req['can_exec_ssh_git_file'],$this->msg['can_exec_ssh_git_file']) = $this->can_exec_ssh_git_file();

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