CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-includes/class.wp-scripts.php

Summary

Maintainability
B
4 hrs
Test Coverage

Function do_item has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function do_item( $handle, $group = false ) {
        if ( !parent::do_item($handle) )
            return false;

        if ( 0 === $group && $this->groups[$handle] > 0 ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class.wp-scripts.php - About 1 hr 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

Method do_item has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function do_item( $handle, $group = false ) {
        if ( !parent::do_item($handle) )
            return false;

        if ( 0 === $group && $this->groups[$handle] > 0 ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class.wp-scripts.php - About 1 hr to fix

    Function print_scripts_l10n has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        function print_scripts_l10n( $handle, $echo = true ) {
            if ( empty($this->registered[$handle]->extra['l10n']) || empty($this->registered[$handle]->extra['l10n'][0]) || !is_array($this->registered[$handle]->extra['l10n'][1]) )
                return false;
    
            $object_name = $this->registered[$handle]->extra['l10n'][0];
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/class.wp-scripts.php - About 45 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

    Function do_footer_items has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        function do_footer_items() {
            if ( !empty($this->in_footer) ) {
                foreach( $this->in_footer as $key => $handle ) {
                    if ( !in_array($handle, $this->done, true) && isset($this->registered[$handle]) ) {
                        $this->do_item($handle);
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/class.wp-scripts.php - About 35 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

    There are no issues that match your filters.

    Category
    Status