Function _generate_sitemap
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
public function _generate_sitemap()
{
main()->NO_GRAPHICS = true;
if ( ! $this->SITE_MAP_ENABLED) {
return 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
File yf_site_map.class.php
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Site Map Generator (implementation of the http://www.sitemaps.org/protocol.php).
*
Function _store_item
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function _store_item($data = [])
{
if (is_string($data) && strlen($data)) {
$data = ['url' => $data];
}
- 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 _generate_sitemap
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _generate_sitemap()
{
main()->NO_GRAPHICS = true;
if ( ! $this->SITE_MAP_ENABLED) {
return false;
Method _store_item
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _store_item($data = [])
{
if (is_string($data) && strlen($data)) {
$data = ['url' => $data];
}
Function _get_modules_from_files
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function _get_modules_from_files()
{
$regex = '~function(\s)+(' . implode('|', $this->HOOK_NAMES) . ')\s*\(~ims';
$yf_prefix_len = strlen(YF_PREFIX);
- 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 _get_modules_from_files
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_modules_from_files()
{
$regex = '~function(\s)+(' . implode('|', $this->HOOK_NAMES) . ')\s*\(~ims';
$yf_prefix_len = strlen(YF_PREFIX);
Method _init
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _init()
{
if ($this->USE_LOCKING) {
$this->LOCK_FILE_NAME = STORAGE_PATH . $this->LOCK_FILE_NAME;
}
Function _init
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _init()
{
if ($this->USE_LOCKING) {
$this->LOCK_FILE_NAME = STORAGE_PATH . $this->LOCK_FILE_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"