Showing 241 of 241 total issues
Function getRewriteConflicts
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getRewriteConflicts()
{
$conflicts = [];
$rewrites = $this->loadRewrites();
foreach ($rewrites as $type => $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
Function collect
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function collect(
Mage_Core_Controller_Request_Http $request,
Mage_Core_Controller_Response_Http $response,
\Exception $exception = null
)
- 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 prepareQueryData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prepareQueryData()
{
$this->queries = [];
$this->identicalQueries = [];
$this->queriesByContext = [];
Method computeErrorsCount
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function computeErrorsCount()
{
$logger = $this->getLogger();
$count = [
'total_log_count' => count($logger->getLogs()),
Method formatQuery
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function formatQuery($sql, $highlightOnly = false)
{
if (@!class_exists('SqlFormatter')) {
return 'SqlFormatter is not installed';
}
Method parseController
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseController($controller)
{
if (is_object($controller)) {
/** @var Mage_Core_Controller_Varien_Front $controller */
Function _isInheritanceConflict
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function _isInheritanceConflict($classes)
{
$count = count($classes);
$classes = array_reverse($classes);
for ($i = 1; $i < $count; $i++) {
- 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 formatArgs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function formatArgs($args)
{
$result = [];
foreach ($args as $key => $item) {
if ('object' === $item[0]) {
- 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 getCategory
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected static function getCategory($timerName)
{
if (isset(self::$sectionMap[$timerName])) {
return self::CATEGORY_SECTION;
}
- 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 getClassNames
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function getClassNames($reload = false)
{
if ($this->classNameCache !== null && $reload === false) {
return $this->classNameCache;
}
- 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 _addData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function _addData($data, $scope, $forceReload = false)
{
$source = debug_backtrace()[1]['function'];
if (isset($this->sourceMap[$source])) {
$source = $this->sourceMap[$source];
- 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 find
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function find($ip, $url, $limit, $method, $start = null, $end = null, $statusCode = null)
Function getCookies
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getCookies($format = self::COOKIES_FLAT)
{
if (!in_array($format, [self::COOKIES_FLAT, self::COOKIES_ARRAY])) {
throw new \InvalidArgumentException(sprintf('Format "%s" invalid (%s).', $format, implode(', ', [self::COOKIES_FLAT, self::COOKIES_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"
Further reading
Function write
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function write(Ecocode_Profiler_Model_Profile $profile)
{
$file = $this->getFilename($profile->getToken());
$profileIndexed = is_file($file);
- 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 collect
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function collect(Mage_Core_Controller_Request_Http $request, Mage_Core_Controller_Response_Http $response, \Exception $exception = null)
{
$stats = [
'load' => 0,
'loop_load' => 0,
- 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 createProfileFromData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function createProfileFromData($token, $data, $parent = null)
{
$profile = new Ecocode_Profiler_Model_Profile($token);
$profile->setIp($data['ip']);
$profile->setMethod($data['method']);
- 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 find
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function find($ip, $url, $limit, $method, $start, $end)
Function getVersion
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getVersion()
{
if (self::$version === null && class_exists('Mage') && $config = Mage::getConfig()) {
//try to load from magento
$config = $config->getModuleConfig('Ecocode_Profiler');
- 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 getUserConfig
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function getUserConfig($asArray = false)
{
if (!$this->userConfig || $asArray) {
$userConfigFile = $this->getUserConfigFile();
- 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 getMenuBlocks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getMenuBlocks()
{
if (!$this->getProfile()) {
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"