Showing 45 of 49 total issues
File class-tgm-plugin-activation.php
has 1058 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Plugin installation and activation for WordPress themes.
*
* @package TGM-Plugin-Activation
Function process_bulk_actions
has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring. Open
public function process_bulk_actions() {
// Bulk installation process.
if ( 'tgmpa-bulk-install' === $this->current_action() ) {
check_admin_referer( 'bulk-' . $this->_args['plural'] );
- 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 notices
has a Cognitive Complexity of 98 (exceeds 5 allowed). Consider refactoring. Open
public function notices() {
global $current_screen;
// Remove nag on the install page.
- 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 om_the_breadcrumbs
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
function om_the_breadcrumbs() {
$text['home'] = 'Home'; // [1]
$text['blog'] = 'Blog';
$text['category'] = '%s Archive'; // [2]
$text['tax'] = '%s'; // [3]
- 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 do_plugin_install
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
protected function do_plugin_install() {
// All plugin information will be stored in an array for processing.
$plugin = 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 process_bulk_actions
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process_bulk_actions() {
// Bulk installation process.
if ( 'tgmpa-bulk-install' === $this->current_action() ) {
check_admin_referer( 'bulk-' . $this->_args['plural'] );
Function _gather_plugin_data
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
protected function _gather_plugin_data() {
// Load thickbox for plugin links.
TGM_Plugin_Activation::$instance->admin_init();
TGM_Plugin_Activation::$instance->thickbox();
- 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 om_the_breadcrumbs
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
function om_the_breadcrumbs() {
$text['home'] = 'Home'; // [1]
$text['blog'] = 'Blog';
$text['category'] = '%s Archive'; // [2]
$text['tax'] = '%s'; // [3]
Method notices
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function notices() {
global $current_screen;
// Remove nag on the install page.
Function run
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function run( $options ) {
// Default config options.
$defaults = array(
'package' => '',
- 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 init
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function init() {
do_action( 'tgmpa_register' );
// After this point, the plugins should be registered and the configuration set.
- 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 do_plugin_install
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function do_plugin_install() {
// All plugin information will be stored in an array for processing.
$plugin = array();
Method _gather_plugin_data
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _gather_plugin_data() {
// Load thickbox for plugin links.
TGM_Plugin_Activation::$instance->admin_init();
TGM_Plugin_Activation::$instance->thickbox();
Method run
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run( $options ) {
// Default config options.
$defaults = array(
'package' => '',
TGM_Plugin_Activation
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class TGM_Plugin_Activation {
/**
* Holds a copy of itself, so it can be referenced by the class name.
*
Function config
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function config( $config ) {
$keys = array( 'default_path', 'has_notices', 'dismissable', 'dismiss_msg', 'menu', 'is_automatic', 'message', 'strings' );
foreach ( $keys as $key ) {
- 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 column_plugin
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function column_plugin( $item ) {
$installed_plugins = get_plugins();
// No need to display any hover links.
Function bulk_install
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function bulk_install( $packages ) {
// Pass installer skin object and set bulk property to true.
$this->init();
$this->bulk = 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 themefiles
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
themefiles: function() {
this.log(chalk.blue('Creating WordPress theme & function files...'));
this.template(
Function after
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function after( $title = '' ) {
// Close install strings.
echo '</p></div>';
- 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"