Showing 68 of 82 total issues
Method createGrammarRules
has 382 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function createGrammarRules(): array
{
return [
new Concatenation(0, ['TypeSystemLanguage'], 'Document'),
new Concatenation(1, ['ExecutableLanguage'], null),
File BaseParser.php
has 588 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This file is part of Phplrt package.
*
* For the full copyright and license information, please view the LICENSE
Method createGrammarRules
has 241 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function createGrammarRules(): array
{
return [
new Repetition(0, 0, -1, 'Directive', null),
new Repetition(1, 0, -1, 'Definition', null),
Method createGrammarRules
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function createGrammarRules(): array
{
return [
new Concatenation(0, ['Value'], null),
(new Concatenation('Json', [0], 'Json'))->setDefaultId('Json'),
Method createDateTime
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createDateTime(ScalarDefinition $reflection): ScalarType
{
$serializeDateTime = function ($value): string {
switch (true) {
case \is_string($value):
Function collect
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function collect(Reader $reader, IOInterface $io): \Traversable
{
$sections = $this->loadConfigs($reader);
foreach ($sections as $name => $configs) {
- 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 render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function render(TokenInterface $token, Readable $sources): string
{
switch ($token->getName()) {
case 'T_CHAR_UTF':
return $this->renderUtfChar($token->getValue(1));
Function filter
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function filter(array $data, array $current = []): array
{
$result = [];
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 compile
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function compile(): void
{
if ($this->completed === false) {
$this->completed = 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 all
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function all(): iterable
{
yield '' => $this->getDirectory();
//
Function isAllowedFor
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function isAllowedFor(?Definition $type): bool
{
if ($type === null) {
return false;
}
- 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 foldSelectionSet
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function foldSelectionSet(SelectionSetNode $selectionSet, int $descend): array
{
$fields = [];
foreach ($selectionSet->selections as $selectionNode) {
- 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 list
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function list(iterable $routes, FieldResolve $event): array
{
$result = [];
foreach ($routes as $route) {
- 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 valueToScalar
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function valueToScalar($value)
{
if (\is_scalar($value)) {
return $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 validateArrayDefaultValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function validateArrayDefaultValue(ArgumentDefinition $type, array $defaults): void
{
if (! $type->isList()) {
$error = \sprintf('%s can not be initialized by List %s',
$type, $this->valueToString($defaults)
- 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 buildType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function buildType(NodeInterface $ast): bool
{
foreach ($ast->getChildren() as $child) {
if ($child->getName() === 'T_NON_NULL') {
if ($this->isList) {
- 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 boot
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function boot(NodeInterface $ast, Document $document): void
{
$this->ast = $ast;
$this->document = $document;
- 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 resolvePreferType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function resolvePreferType(FieldDefinition $field, ResolveInfo $info): array
{
$types = [];
foreach ($info->fieldNodes as $node) {
- 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 preload
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function preload(Dictionary $dictionary): void
{
foreach ($dictionary->all() as $type) {
if ($type instanceof ObjectDefinition && $type->getNumberOfInterfaces() > 0) {
$this->types[] = $this->loadType($type->getName());
- 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 parseArgumentValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function parseArgumentValue(NodeInterface $ast): array
{
[$key, $value] = [null, null];
foreach ($ast->getChildren() as $child) {
- 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"