Showing 169 of 169 total issues
Method pullData
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function pullData()
{
if ($this->pluginsByTypes === null) {
$this->pluginsByTypes = [];
Avoid using undefined variables such as '$cacheEvents' which will lead to PHP notices. Open
if(empty($cacheEvents[$identifier])) {
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Method execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->resourceConfig->saveConfig('dev/quickdevbar/enable', $this->status);
$output->writeln("<info>" . $this->message . "</info>");
Method tailFile
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tailFile($filepath, $lines = 1, $adaptive = true)
{
// Open file
$f = @fopen($filepath, "rb");
if ($f === false) {
Method pullData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function pullData()
{
$request = $this->requestHttp;
$requestData = [];
$requestData[] = ['name' => 'Date sys', 'value' => date("Y-m-d H:i:s")];
Function getTreeBlocksHierarchy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getTreeBlocksHierarchy($layout)
{
//$layout = $this->getLayout();
$reflection = new \ReflectionClass($layout);
- 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 execute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function execute()
{
$fileKey = $this->getRequest()->getParam('log_key', '');
$output = '';
- 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 __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
\Magento\Framework\App\Action\Context $context,
\ADM\QuickDevBar\Helper\Data $qdbHelper,
\Magento\Framework\Controller\Result\RawFactory $resultRawFactory,
\Magento\Framework\View\LayoutFactory $layoutFactory,
\Magento\Config\Model\ResourceModel\Config $resourceConfig,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
\Magento\Framework\App\Helper\Context $context,
\Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool,
\Magento\Framework\Module\ModuleListInterface $moduleList,
\Magento\Framework\Filesystem $filesystem,
array $ideList,
The property $_mainTabs is not named in camelCase. Open
class Wrapper extends Panel
{
protected $_mainTabs;
protected $_jsonHelper;
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_qdnHelper is not named in camelCase. Open
class Toolbar extends \Magento\Framework\View\Element\Template
{
protected $_mainTabs;
protected $_qdnHelper;
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_qdbHelperRegister is not named in camelCase. Open
class Response
{
/**
*
* @var \ADM\QuickDevBar\Helper\Register
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_tabs is not named in camelCase. Open
class ConfigSearch extends \ADM\QuickDevBar\Controller\Index
{
/**
* Tabs
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_configStructure is not named in camelCase. Open
class ConfigSearch extends \ADM\QuickDevBar\Controller\Index
{
/**
* Tabs
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_layoutFactory is not named in camelCase. Open
abstract class Index extends \Magento\Backend\App\Action
{
/**
* @var \Magento\Framework\View\LayoutFactory
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_resultRawFactory is not named in camelCase. Open
abstract class Index extends \Magento\Backend\App\Action
{
/**
* @var \Magento\Framework\View\LayoutFactory
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_storeManager is not named in camelCase. Open
class ConfigUpdate extends \ADM\QuickDevBar\Controller\Index
{
/**
* @var \Magento\Config\Model\Resource\Config
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_resultForwardFactory is not named in camelCase. Open
class ConfigUpdate extends \ADM\QuickDevBar\Controller\Index
{
/**
* @var \Magento\Config\Model\Resource\Config
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
Avoid variables with short names like $id. Configured minimum length is 3. Open
$id = ($this->getData('id')) ? $this->getData('id') : $this->getNameInLayout();
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
The property $_layoutFactory is not named in camelCase. Open
class Index extends \Magento\Framework\App\Action\Action
{
/**
* @var \ADM\QuickDevBar\Helper\Data
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}