Showing 26 of 816 total issues
Function createSection
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function createSection(string $name, array $data, $makeNested = true): array
{
$query = [];
if (method_exists($this, $name)) {
- 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 populatePlaceHoldersWithData
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function populatePlaceHoldersWithData(array $query, array $data): array
{
$newQuery = [];
foreach ($query as $term => $value) {
- 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
Bootstraper
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Bootstraper
{
/**
* The system instance
*
Method execute
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
if (!$input->getOption('username') && !$input->getOption('id')) {
$output->writeln('One of <info>id</info> or <info>username</info> options are required.');
Method createSection
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createSection(string $name, array $data, $makeNested = true): array
{
$query = [];
if (method_exists($this, $name)) {
Function execute
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
if (!$input->getOption('username') && !$input->getOption('id')) {
$output->writeln('One of <info>id</info> or <info>username</info> options are required.');
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$mappings = $this->getMappings($input, $output, sys()->getConfig('elasticsearch.mappings'));
foreach ($mappings as $index => $mapping) {
- 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 populatePlaceHoldersWithData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function populatePlaceHoldersWithData(array $query, array $data): array
{
$newQuery = [];
foreach ($query as $term => $value) {
Method configure
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
$this->setName('auth:admin-user')
->setDescription('Make or remove a user from admin role')
->addOption(
Method getConfigurationOptions
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getConfigurationOptions(System $system): array
{
return [
'auto_eject_hosts' => $system->getConfig('auto_eject_hosts', false),
'buffer_writes' => $system->getConfig('buffer_writes', false),
Method getMappings
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getMappings(InputInterface $input, OutputInterface $output, array $configMappings): array
{
$mappings = [];
if ($input->getOption('index')) {
Method fire
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fire()
{
// TODO: use event listener on exceptions
try {
$request = Request::createFromGlobals();
Method configure
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
$this->setName('auth:create-user')
->setDescription('Create a new user')
->addArgument(
Function runMiddleware
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Confirmed
public function runMiddleware(RouteResolvedEvent $event)
{
$route = $event->getRoute();
$middlewares = (array)$route->getDefault('middleware');
$toRun = [];
- 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 match
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function match(array $query, string $from = 'must', $makeNested = true): array
{
$newQuery = [];
foreach ($query as $term => $value) {
- 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 getSearchData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function getSearchData($data, string $prefix = ''): array
{
$newData = [];
foreach ($data as $key => $value) {
- 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 getMappings
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function getMappings(InputInterface $input, OutputInterface $output, array $configMappings): array
{
$mappings = [];
if ($input->getOption('index')) {
- 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 generateNestedMapping
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function generateNestedMapping(array $mapping, bool $nestedCall = false): array
{
$final = [];
foreach ($mapping as $item => $value) {
- 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 loadModuleRoutes
has 5 arguments (exceeds 4 allowed). Consider refactoring. Confirmed
RouteCollection $routes,
array $module,
string $name,
?string $dir = null,
?string $file = null
Method makeNested
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function makeNested(string $field, string $term, string $wrapper, $data, bool $negate = true): array