Function admin_scripts
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function admin_scripts() {
global $post_type;
$screen = get_current_screen();
- 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 admin_scripts
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function admin_scripts() {
global $post_type;
$screen = get_current_screen();
File class.llms.admin.assets.php
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* LLMS_Admin_Assets class
*
* @package LifterLMS/Admin/Classes
Method block_editor_assets_for_certificates
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function block_editor_assets_for_certificates() {
llms()->assets->enqueue_script( 'llms-admin-certificate-editor' );
$settings = array(
Method admin_print_scripts
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function admin_print_scripts() {
$screen = get_current_screen();
global $post;
Function maybe_enqueue_reporting
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function maybe_enqueue_reporting( $screen ) {
if ( in_array( $screen->base, array( 'lifterlms_page_llms-reporting', 'lifterlms_page_llms-dashboard', 'dashboard' ), true ) ) {
$current_tab = llms_filter_input( INPUT_GET, 'tab' );
- 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 false;
Avoid too many return
statements within this method. Open
return true;
Function is_llms_page
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function is_llms_page() {
$screen = get_current_screen();
$id = str_replace( 'edit-', '', $screen->id );
- 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"