Showing 29 of 4,852 total issues
File class-git-wrapper.php
has 522 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
Git_Wrapper
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
class Git_Wrapper {
private $last_error = '';
private $gitignore = GITIGNORE;
Function gitium_upgrader_post_install
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
function gitium_upgrader_post_install( $res, $hook_extra, $result ) {
_gitium_make_ssh_git_file_exe();
$action = null;
$type = null;
- Read upRead up
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 _gitium_module_by_path
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function _gitium_module_by_path( $path ) {
$versions = gitium_get_versions();
// default values
$module = array(
- Read upRead up
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
File functions.php
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
Method gitium_upgrader_post_install
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function gitium_upgrader_post_install( $res, $hook_extra, $result ) {
_gitium_make_ssh_git_file_exe();
$action = null;
$type = null;
File gitium.php
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Plugin Name: Gitium
* Version: 1.0.6
* Author: Presslabs
Function add_menu_bubble
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function add_menu_bubble() {
global $menu;
if ( ! _gitium_is_status_working() ) {
foreach ( $menu as $key => $value ) {
- Read upRead up
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 local_status
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function local_status() {
list( $return, $response ) = $this->_call( 'status', '-s', '-b', '-u' );
if ( 0 !== $return ) {
return array( '', array() );
}
- Read upRead up
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
Method _gitium_module_by_path
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _gitium_module_by_path( $path ) {
$versions = gitium_get_versions();
// default values
$module = array(
Method gitium_update_versions
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function gitium_update_versions() {
$new_versions = [];
// get all themes from WP
$all_themes = wp_get_themes( array( 'allowed' => true ) );
Function get_local_changes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function get_local_changes() {
list( $return, $response ) = $this->_call( 'status', '--porcelain' );
if ( 0 !== $return ) {
return array();
- Read upRead up
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
Method page
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function page() {
?>
<div class="wrap">
<h2><?php printf( __( 'Last %s commits', 'gitium' ), GITIUM_LAST_COMMITS ); ?></h2>
<table class="wp-list-table widefat plugins">
Method _call
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _call(...$args) {
$args = join( ' ', array_map( 'escapeshellarg', $args ) );
$return = -1;
$response = array();
$env = $this->get_env();
Method setup_step_2
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setup_step_2() {
$git = $this->git; ?>
<div class="wrap">
<h2><?php _e( 'Configuration step 2', 'gitium' ); ?></h2>
<p><?php _e( 'If you need help to set this up, please click on the "Help" button from the top right corner of this screen.' ); ?></p>
Method merge_with_accept_mine
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function merge_with_accept_mine(...$commits) {
do_action( 'gitium_before_merge_with_accept_mine' );
if ( 1 == count($commits) && is_array( $commits[0] ) ) {
$commits = $commits[0];
Method show_git_changes_table_rows
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function show_git_changes_table_rows( $changes = '' ) {
?>
<script type="application/javascript">
function add_path_and_submit( elem ) {
var container = document.getElementById( 'form_status' );
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 ) );
- Read upRead up
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 status
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function status( $local_only = false ) {
list( $branch_status, $new_response ) = $this->local_status();
if ( $local_only ) { return array( $branch_status, $new_response ); }
- Read upRead up
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 cherry_pick
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function cherry_pick( $commits ) {
foreach ( $commits as $commit ) {
if ( empty( $commit ) ) { return false; }
list( $return, $response ) = $this->_call( 'cherry-pick', $commit );
- Read upRead up
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"