sroehrl/neoan.io-lenkrad-core

View on GitHub

Showing 28 of 31 total issues

Function extractParameters has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function extractParameters(string &$fullPath): array
    {
        $hit = preg_match_all('/\/:(\w+)(\*){0,1}/',$fullPath, $matches, PREG_SET_ORDER);
        $parameters = [];
        if($hit){
Severity: Minor
Found in src/Routing/Route.php - About 35 mins to fix

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 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function execute(array $route): void
    {
        if (empty($route['classes'])) {
            Response::output($route['injections'], [$route['view'] ?? null]);
        } else {
Severity: Minor
Found in src/Routing/Route.php - About 35 mins to fix

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 executeAttributes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function executeAttributes(array $attributes, string $propertyName, AttributeType $type, Direction $direction): void
    {
        foreach ($attributes as $attribute) {
            if ($attribute['type'] === $type) {
                $interim = $attribute['instance']($this->currentModel->toArray(), $direction, $propertyName);
Severity: Minor
Found in src/Model/Interpreter.php - About 35 mins to fix

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 toArray has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function toArray(bool $flat = false): array
    {
        $ignore = ['transactionMode', 'notify'];
        $values = get_object_vars($this);
        foreach ($ignore as $key) {
Severity: Minor
Found in src/Model/Model.php - About 35 mins to fix

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 generateSelect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function generateSelect(): array
    {
        $this->selectorString = '';
        $this->mutationAttributes = [];
        foreach ($this->reflection->properties as $i => $property) {
Severity: Minor
Found in src/Model/Interpreter.php - About 35 mins to fix

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 __invoke has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function __invoke(NeoanApp $app): void
    {

        $instance = self::getInstance();
        $instance->provider = $app->injectionProvider;
Severity: Minor
Found in src/Routing/Route.php - About 25 mins to fix

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 generateMachLists has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function generateMachLists(): void
    {
        foreach ($this->properties as $property) {
            $attributes = $property->getAttributes();
            $this->propertyMatchList[$property->getName()] = $attributes;
Severity: Minor
Found in src/Helper/AttributeHelper.php - About 25 mins to fix

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 readComposer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function readComposer(): void
    {
        // read composer
        $composerFile = json_decode(file_get_contents(self::$neoanApp->cliPath . '/composer.json'), true);
        if (isset($composerFile['autoload']['psr-4'])) {
Severity: Minor
Found in src/Cli/Create/FileCreator.php - About 25 mins to fix

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

Severity
Category
Status
Source
Language