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) {
- 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
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);
- 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
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')
- 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 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) {
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);
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());
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;
- 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
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());
- 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"