Showing 185 of 185 total issues
The property $_qdbHelper 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;
}
Source
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;
}
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 $_resultRawFactory 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;
}
Source
Function isToolbarAccessAllowed
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function isToolbarAccessAllowed($testWithRestriction=false)
{
$allow = false;
$enable = $this->getQdbConfig('enable');
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(Config $resourceConfig,
Manager $cacheManager,
EventManagerInterface $eventManager,
Writer $writer,
ArrayManager $arrayManager,
The class Translate has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13. Open
class Translate extends \Magento\Framework\Translate
{
/**
* Checks if we have loaded our translation data.
*
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
The class Data has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13. Open
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
/**
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(Http $requestHttp,
State $appState,
ProductMetadataInterface $productMetadata,
FrontNameResolver $frontNameResolver,
Session $session
Method computeQueryGrade
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function computeQueryGrade($allQueries, $shortestQueryTime, $longestQueryTime, $totalNumQueries, $average)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
\Magento\Framework\View\Element\Template\Context $context,
\Magento\Framework\Json\Helper\Data $jsonHelper,
\ADM\QuickDevBar\Helper\Data $qdbHelper,
\ADM\QuickDevBar\Helper\Register $qdbHelperRegister,
array $data = []
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(\Magento\Framework\App\Action\Context $context,
\ADM\QuickDevBar\Helper\Data $qdbHelper,
\ADM\QuickDevBar\Helper\Register $qdbHelperRegister,
\Magento\Framework\Controller\Result\RawFactory $resultRawFactory,
\Magento\Framework\View\LayoutFactory $layoutFactory)
Method beforeSave
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
PageCache $subject,
string $data,
string $identifier,
array $tags = [],
$lifeTime = null
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
\Magento\Framework\View\Element\Template\Context $context,
\ADM\QuickDevBar\Helper\Data $qdbHelper,
\ADM\QuickDevBar\Helper\Register $qdbHelperRegister,
DataObjectFactory $objectFactory,
array $data = []
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Template\Context $context,
Translate $translate,
\ADM\QuickDevBar\Helper\Data $qdbHelper,
\ADM\QuickDevBar\Helper\Register $qdbHelperRegister,
array $data = []
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(\Magento\Framework\App\Action\Context $context,
\Magento\Framework\Controller\Result\RawFactory $resultRawFactory,
\Magento\Framework\View\LayoutFactory $layoutFactory,
\ADM\QuickDevBar\Helper\Data $qdbHelper,
\ADM\QuickDevBar\Helper\Register $qdbHelperRegister
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
\Magento\Framework\View\Element\Template\Context $context,
\Magento\Framework\Json\Helper\Data $jsonHelper,
\ADM\QuickDevBar\Helper\Data $qdbHelper,
\ADM\QuickDevBar\Helper\Register $qdbHelperRegister,
array $data = []
Method __construct
has 5 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\Config\Structure $configStructure
Method beforeSave
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
CacheInterface $subject,
string $data,
string $identifier,
array $tags = [],
$lifeTime = null
Method __construct
has 5 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\Framework\View\Asset\MergeService $mergeService