Showing 18 of 23 total issues
Function __invoke
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
public function __invoke(ValidatorDefinition $requestValidatorDefinition)
{
$request = $requestValidatorDefinition->getArgument();
Assertion::isInstanceOf($request, DaikonRequest::class);
if (!empty($payload = $request->getPayload([]))) {
- 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
DaikonRequest
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
class DaikonRequest implements ServerRequestInterface
{
public const ERRORS = '_errors';
public const PAYLOAD = '_payload';
public const STATUS_CODE = '_status_code';
Method __invoke
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __invoke(ValidatorDefinition $requestValidatorDefinition)
{
$request = $requestValidatorDefinition->getArgument();
Assertion::isInstanceOf($request, DaikonRequest::class);
if (!empty($payload = $request->getPayload([]))) {
Method provision
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function provision(
Injector $injector,
ConfigProviderInterface $configProvider,
ServiceDefinitionInterface $serviceDefinition
): void {
Function execute
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$target = $input->getOption('target');
$from = intval($input->getOption('from'));
- 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 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$target = $input->getOption('target');
$from = intval($input->getOption('from'));
Function execute
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$target = $input->getOption('target');
$version = intval($input->getOption('to'));
- 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 loadConfiguration
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function loadConfiguration(array $bootParams): ConfigProviderInterface
{
$bootParams['daikon'] = ['config_dir' => dirname(dirname(__DIR__)) . '/config'];
return new ConfigProvider(
new ConfigProviderParams(
Method execute
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
if (!count($this->crateMap) || !count($this->migrationTargetMap)) {
$output->writeln('<error>There are no targets available to generate migrations for.</error>');
$output->writeln('');
Function execute
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$target = $input->getOption('target');
$version = intval($input->getOption('to'));
- 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 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(ActionInterface $action, DaikonRequest $request): ResponseInterface
{
try {
if ($validator = $action->getValidator($request)) {
$validatorDefinition = (new ValidatorDefinition('$', Severity::critical()))->withArgument($request);
Function renderValues
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function renderValues(OutputInterface $output, array $settings, int $indent = 0): void
{
foreach ($settings as $key => $value) {
if (is_scalar($value) || is_null($value)) {
switch (true) {
- 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 buildLazySubscription
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function buildLazySubscription(
Injector $injector,
string $serviceFqcn,
string $subscriptionKey,
array $subscriptionConfig,
Function load
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function load(array $locations, array $sources): array
{
$router = $this->router;
//these variables are in scope for included routing files
$map = $router->getMap();
- 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 buildLazySubscription
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Injector $injector,
string $serviceFqcn,
string $subscriptionKey,
array $subscriptionConfig,
TransportMap $transportMap
Avoid too many return
statements within this method. Open
return Factory::createResponse(self::STATUS_INTERNAL_SERVER_ERROR);
Function provision
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function provision(
Injector $injector,
ConfigProviderInterface $configProvider,
ServiceDefinitionInterface $serviceDefinition
): void {
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
if (!count($this->crateMap) || !count($this->migrationTargetMap)) {
$output->writeln('<error>There are no targets available to generate migrations for.</error>');
$output->writeln('');
- 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"