Showing 48 of 185 total issues
Function pullData
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function pullData()
{
if ($this->pluginsByTypes === null) {
$this->pluginsByTypes = [];
- 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 24 (exceeds 5 allowed). Consider refactoring. Open
public function execute()
{
$error = false;
$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
Data
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
/**
Function initSqlProfilerData
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
protected function initSqlProfilerData()
{
$longestQueryTime = 0;
$shortestQueryTime = 100000;
$longestQuery = '';
- 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 execute
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute()
{
$error = false;
$output = '';
File Data.php
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace ADM\QuickDevBar\Helper;
use Magento\Customer\Model\Session;
use Magento\Framework\App\Config\ScopeConfigInterface;
Panel
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Panel extends \Magento\Framework\View\Element\Template
{
protected $_mainTabs;
protected $_frontUrl;
Method initSqlProfilerData
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function initSqlProfilerData()
{
$longestQueryTime = 0;
$shortestQueryTime = 100000;
$longestQuery = '';
Function getHtmlBlocksHierarchy
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getHtmlBlocksHierarchy($treeBlocks = [], $level = 0)
{
if (empty($treeBlocks)) {
$treeBlocks = [$this->qdbHelperRegister->getLayoutHierarchy()];
}
- 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 getWrapperContent
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getWrapperContent($ajax = false)
{
//Clean old files
// /** @var \SplFileInfo $fileInfo */
// foreach (new \DirectoryIterator($this->getQdbTempDir()) as $fileInfo) {
- 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 buildTreeBlocks
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function buildTreeBlocks($layout, $name = 'root', $alias = '')
{
$element = $this->getElementByName($name);
if ($element) {
$treeBlocks = [
- 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 trace
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function trace(array $trace=[], $skipLine = null)
{
if(empty($trace)) {
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
is_null($skipLine) && $skipLine=1;
- 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 14 arguments (exceeds 4 allowed). Consider refactoring. Open
DesignInterface $viewDesign,
FrontendInterface $cache,
ViewFileSystem $viewFileSystem,
ModuleList $moduleList,
Reader $modulesReader,
Function load
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
load: function( index, event ) {
index = this._getIndex( index );
let that = this,
tab = this.tabs.eq( index ),
anchor = tab.find( ".ui-tabs-anchor" ),
Method getHtmlBlocksHierarchy
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getHtmlBlocksHierarchy($treeBlocks = [], $level = 0)
{
if (empty($treeBlocks)) {
$treeBlocks = [$this->qdbHelperRegister->getLayoutHierarchy()];
}
Method buildTreeBlocks
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function buildTreeBlocks($layout, $name = 'root', $alias = '')
{
$element = $this->getElementByName($name);
if ($element) {
$treeBlocks = [
Method pullData
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function pullData()
{
if ($this->pluginsByTypes === null) {
$this->pluginsByTypes = [];
Method getWrapperContent
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getWrapperContent($ajax = false)
{
//Clean old files
// /** @var \SplFileInfo $fileInfo */
// foreach (new \DirectoryIterator($this->getQdbTempDir()) as $fileInfo) {
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 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")];