CaffGeek/MBACNationals

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

Summary

Maintainability
C
7 hrs
Test Coverage

Function all_deps has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    function all_deps( $handles, $recursion = false, $group = false ) {
        if ( !$handles = (array) $handles )
            return false;

        foreach ( $handles as $handle ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class.wp-dependencies.php - About 3 hrs 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_items has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    function do_items( $handles = false, $group = false ) {
        // Print the queue if nothing is passed.  If a string is passed, print that script.  If an array is passed, print those scripts.
        $handles = false === $handles ? $this->queue : (array) $handles;
        $this->all_deps( $handles );

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class.wp-dependencies.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 all_deps has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function all_deps( $handles, $recursion = false, $group = false ) {
        if ( !$handles = (array) $handles )
            return false;

        foreach ( $handles as $handle ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class.wp-dependencies.php - About 1 hr to fix

    Method add has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        function add( $handle, $src, $deps = array(), $ver = false, $args = null ) {
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/class.wp-dependencies.php - About 35 mins to fix

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

          function query( $handle, $list = 'registered' ) { // registered, queue, done, to_do
              switch ( $list ) :
              case 'registered':
              case 'scripts': // back compat
                  if ( isset($this->registered[$handle]) )
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/class.wp-dependencies.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

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

          function enqueue( $handles ) {
              foreach ( (array) $handles as $handle ) {
                  $handle = explode('?', $handle);
                  if ( !in_array($handle[0], $this->queue) && isset($this->registered[$handle[0]]) ) {
                      $this->queue[] = $handle[0];
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/class.wp-dependencies.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