PressLabs/gitium

View on GitHub

Showing 4,852 of 4,852 total issues

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

class Gitium_Requirements {

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

class Gitium_Submenu_Settings extends Gitium_Menu {

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

class Gitium_Submenu_Status extends Gitium_Menu {

Function gitium_update_versions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function gitium_update_versions() {
    $new_versions = [];

    // get all themes from WP
    $all_themes = wp_get_themes( array( 'allowed' => true ) );
Severity: Minor
Found in gitium/gitium.php - About 55 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

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 18 and the first side effect is on line 37.
Open

<?php
Severity: Minor
Found in gitium/functions.php by phpcodesniffer

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 19 and the first side effect is on line 18.
Open

<?php
Severity: Minor
Found in gitium/gitium-webhook.php by phpcodesniffer

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 28 and the first side effect is on line 42.
Open

<?php
Severity: Minor
Found in gitium/gitium.php by phpcodesniffer

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 19 and the first side effect is on line 18.
Open

<?php

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 18 and the first side effect is on line 49.
Open

<?php

The parameter $update_transient is not named in camelCase.
Open

function _gitium_is_status_working( $update_transient = false ) {
    if ( ! $update_transient && ( false !== ( $is_status_working = get_transient( 'gitium_is_status_working' ) ) ) ) {
        return $is_status_working;
    } else {
        return gitium_update_is_status_working();
Severity: Minor
Found in gitium/functions.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 $update_transient is not named in camelCase.
Open

function _gitium_get_remote_tracking_branch( $update_transient = false ) {
    if ( ! $update_transient && ( false !== ( $remote_branch = get_transient( 'gitium_remote_tracking_branch' ) ) ) ) {
        return $remote_branch;
    } else {
        return gitium_update_remote_tracking_branch();
Severity: Minor
Found in gitium/functions.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 property $private_key is not named in camelCase.
Open

class Git_Wrapper {

    private $last_error = '';
    private $gitignore  = GITIGNORE;

Severity: Minor
Found in gitium/inc/class-git-wrapper.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 $repo_dir is not named in camelCase.
Open

    function __construct( $repo_dir ) {
        $this->repo_dir = $repo_dir;
    }
Severity: Minor
Found in gitium/inc/class-git-wrapper.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 $hook_extra is not named in camelCase.
Open

function gitium_upgrader_post_install( $res, $hook_extra, $result ) {
    _gitium_make_ssh_git_file_exe();

    $action = null;
    $type   = null;
Severity: Minor
Found in gitium/gitium.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 Git_Wrapper is not named in CamelCase.
Open

class Git_Wrapper {

    private $last_error = '';
    private $gitignore  = GITIGNORE;

Severity: Minor
Found in gitium/inc/class-git-wrapper.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 parameter $msg_append is not named in camelCase.
Open

function gitium_group_commit_modified_plugins_and_themes( $msg_append = '' ) {
    global $git;

    $uncommited_changes = $git->get_local_changes();
    $commit_groups = array();
Severity: Minor
Found in gitium/functions.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 $generate_new_keypair is not named in camelCase.
Open

function gitium_get_keypair( $generate_new_keypair = false ) {
    if ( $generate_new_keypair ) {
        $keypair = _gitium_generate_keypair();
        delete_option( 'gitium_keypair' );
        add_option( 'gitium_keypair', $keypair, '', false );
Severity: Minor
Found in gitium/functions.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 $msg_prepend is not named in camelCase.
Open

function gitium_auto_push( $msg_prepend = '' ) {
    global $git;
    list( , $git_private_key ) = gitium_get_keypair();
    if ( ! $git_private_key )
        return;
Severity: Minor
Found in gitium/gitium.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_Admin is not named in CamelCase.
Open

class Gitium_Admin {

    public function __construct() {
        global $git;

Severity: Minor
Found in gitium/inc/class-gitium-admin.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 $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

Severity
Category
Status
Source
Language