CaffGeek/MBACNationals

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

Summary

Maintainability
D
2 days
Test Coverage

Function start_element has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    function start_element($parser, $name, $attrs) {

        $tag = array_pop(split(":", $name));

        switch($name) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/atomlib.php - About 5 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 end_element has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    function end_element($parser, $name) {

        $tag = array_pop(split(":", $name));

        $ccount = count($this->in_content);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/atomlib.php - About 4 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 ns_to_prefix has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    function ns_to_prefix($qname, $attr=false) {
        # split 'http://www.w3.org/1999/xhtml:div' into ('http','//www.w3.org/1999/xhtml','div')
        $components = split(":", $qname);

        # grab the last one (e.g 'div')
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/atomlib.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

Method start_element has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function start_element($parser, $name, $attrs) {

        $tag = array_pop(split(":", $name));

        switch($name) {
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/atomlib.php - About 2 hrs to fix

    Method end_element has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function end_element($parser, $name) {
    
            $tag = array_pop(split(":", $name));
    
            $ccount = count($this->in_content);
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/atomlib.php - About 1 hr to fix

      Method parse has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function parse() {
      
              set_error_handler(array(&$this, 'error_handler'));
      
              array_unshift($this->ns_contexts, array());
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/atomlib.php - About 1 hr to fix

        Function is_declared_content_ns has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            function is_declared_content_ns($new_mapping) {
                foreach($this->content_ns_contexts as $context) {
                    foreach($context as $mapping) {
                        if($new_mapping == $mapping) {
                            return true;
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/atomlib.php - About 25 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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            function parse() {
        
                set_error_handler(array(&$this, 'error_handler'));
        
                array_unshift($this->ns_contexts, array());
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/atomlib.php - About 25 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