Method manual_update
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function manual_update() {
ob_start();
$locale = get_locale();
$creds = request_filesystem_credentials( $_GET['security'], '', false, false, null );
Function manual_update
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function manual_update() {
ob_start();
$locale = get_locale();
$creds = request_filesystem_credentials( $_GET['security'], '', false, false, 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
Method update_check
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update_check( $transient, $force = false ) {
$locale = get_locale();
// pre_set_site_transient_update_plugins is called twice
// we only want to act on the second run
Method get_external_library_locale_js
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function get_external_library_locale_js( $library = '', $version = '' ) {
$cdnjs_url = $locale_js = '';
switch ( $library ) {
case 'select2':
Function get_external_library_locale_js
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
static public function get_external_library_locale_js( $library = '', $version = '' ) {
$cdnjs_url = $locale_js = '';
switch ( $library ) {
case 'select2':
- 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
Avoid too many return
statements within this method. Open
return $transient;
Function update_check
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function update_check( $transient, $force = false ) {
$locale = get_locale();
// pre_set_site_transient_update_plugins is called twice
// we only want to act on the second run
- 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"