Showing 10 of 10 total issues
Method asXml
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function asXml() {
$exception = $this->_exception;
$options = $this->_options;
$builder = new Errbit_XmlBuilder();
$self = $this;
Method _checkConfig
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _checkConfig() {
if (empty($this->_config['api_key'])) {
throw new Errbit_Exception("`api_key' must be configured");
}
Function _checkConfig
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function _checkConfig() {
if (empty($this->_config['api_key'])) {
throw new Errbit_Exception("`api_key' must be configured");
}
- 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 tag
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function tag($name /* , $value, $attributes, $callback */) {
$value = '';
$attributes = array();
$callback = null;
$args = func_get_args();
Function tag
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function tag($name /* , $value, $attributes, $callback */) {
$value = '';
$attributes = array();
$callback = null;
$args = func_get_args();
- 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
Consider simplifying this complex logical expression. Open
if (!empty($options['url'])
|| !empty($options['controller'])
|| !empty($options['action'])
|| !empty($options['parameters'])
|| !empty($options['session_data'])
Function _filterParams
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function _filterParams($name) {
if (empty($this->_options[$name])) {
return;
}
- 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 log
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function log($message, $priority = null)
{
// If message contains one of ignored messages, shut down
foreach (self::$ignoredMessages as $ignoredMessage) {
if (strpos($message[1], $ignoredMessage) !== false) {
- 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 $name;
Function xmlVarsFor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function xmlVarsFor($builder, $array) {
foreach ($array as $key => $value) {
if (is_object($value)) {
$value = (array)$value;
}
- 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"