Showing 8 of 54 total issues
Method execute
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln([ // outputs multiple lines to the console (adding "\n" at the end of each line)
'MyAdmin DocBlock Parser',
'=======================',
Function get_module_db
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function get_module_db($module)
{
if ($module == 'powerdns') {
if (!isset($GLOBALS['powerdns_dbh'])) {
$GLOBALS['powerdns_dbh'] = new \MyDb\Mdb2\Db(POWERDNS_DB, POWERDNS_USER, POWERDNS_PASSWORD, POWERDNS_HOST);
- 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 get_module_name
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function get_module_name($module = 'default')
{
if ($module != 'default') {
if (isset($GLOBALS[$module.'_dbh'])) {
return $module;
- 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 add_route_requirement
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function add_route_requirement($type, $function, $source = '', $path = false, $methods = false)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(IOInterface $io, Composer $composer, $type = 'library', Filesystem $filesystem = null, BinaryInstaller $binaryInstaller = null)
Function do_call
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function do_call($parent, $call, $calls)
{
echo "Running \$parent->$call();".PHP_EOL;
$response = $parent->$call();
if (isset($calls[$call])) {
- 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
Avoid too many return
statements within this method. Open
return 'default';
Function get_module_settings
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function get_module_settings($module = 'default', $setting = false)
{
if (!isset($GLOBALS['modules'][$module])) {
$keys = array_keys($GLOBALS['modules']);
$module = $keys[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"