brainworxx/kreXX

View on GitHub

Showing 19 of 23 total issues

Function cleanupVarName has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function cleanupVarName(string $name): string
    {
        // We start with a -1, because we need to stop right before. every opening
        // bracket has a closing one.
        $level = -1;
Severity: Minor
Found in src/Analyse/Caller/CallerFinder.php - About 1 hr 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 readSettings has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public readSettings(cookieName:string): string|object
    {
        /** @type {string} */
        cookieName = cookieName + "=";
        let cookieArray:string[] = document.cookie.split(';');
Severity: Minor
Found in src/View/Skins/TypeScript/Kdt.ts - About 45 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 getCurrentUrl has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getCurrentUrl(): string
    {
        $server = $this->pool->getServer();

        // Check if someone has been messing with the $_SERVER, to prevent
Severity: Minor
Found in src/Analyse/Caller/AbstractCaller.php - About 45 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 isAllowedDebugCall has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function isAllowedDebugCall($data, string $method): bool
    {
        // Check if the class itself is blacklisted.
        foreach ($this->classBlacklist as $classname) {
            if ($data instanceof $classname) {
Severity: Minor
Found in src/Service/Config/Validation.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 addPropertyDumper has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addPropertyDumper(array &$stuffToDump): void
    {
        $isInScope = $this->pool->scope->isInScope();
        $config = $this->pool->config;

Severity: Minor
Found in src/Analyse/Callback/Analyse/Objects.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 checkIfAccessible has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function checkIfAccessible($data, string $funcName, ReflectionClass $reflectionClass): bool
    {
        // We need to check if:
        // 1. Method exists. It may be protected though.
        // 2. Method can be called. There may be a magical method, though.
Severity: Minor
Found in src/Analyse/Callback/Analyse/Objects/DebugMethods.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 parse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function parse(string $string = "\n"): string
    {
        switch ($result = $this->read(1)) {
            case 'N':
                // Null handling.
Severity: Minor
Found in src/Service/Misc/FormatSerialize.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 generateName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function generateName(ReflectionClass $ref): string
    {
        $result = '';
        if ($ref->isFinal() === true) {
            $result .= 'final ';
Severity: Minor
Found in src/Analyse/Callback/Analyse/Objects/Meta.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 cleanupOldChunks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function cleanupOldChunks(): Cleanup
    {
        // Check for write access. We also do this only once.
        if (static::$chunksDone === true || $this->pool->chunks->getChunksAreAllowed() === false) {
            return $this;
Severity: Minor
Found in src/Service/Misc/Cleanup.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 generateComplicatedStuff has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function generateComplicatedStuff(Model $model): string
    {
        // Define a fallback value.
        $result = static::UNKNOWN_VALUE;

Severity: Minor
Found in src/Analyse/Code/Codegen.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 getDeclarationKeywords has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getDeclarationKeywords(
        ReflectionMethod $reflectionMethod,
        ReflectionClass $declaringClass,
        ReflectionClass $reflectionClass
    ): string {
Severity: Minor
Found in src/Analyse/Callback/Iterate/ThroughMethods.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 handleNoneReflections has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function handleNoneReflections(string $key, $meta): string
    {
        $messages = $this->pool->messages;
        /** @var Model $model */
        $model = $this->pool->createClass(Model::class)->setData($meta)->setName($key)
Severity: Minor
Found in src/Analyse/Callback/Iterate/ThroughMeta.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 retrieveDefaultValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function retrieveDefaultValue(ReflectionProperty $property): string
    {
        $default = null;

        try {
Severity: Minor
Found in src/Analyse/Callback/Iterate/ThroughProperties.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 getBacktrace has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getBacktrace(): array
    {
        // Remove the fist step from the backtrace,
        // because that is the internal function in kreXX.
        $backtrace = debug_backtrace();
Severity: Minor
Found in src/Analyse/Routing/Process/ProcessBacktrace.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 populateGetterLists has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function populateGetterLists(ReflectionMethod $method, ReflectionClass $ref): void
    {
        // Check, if the method is really available, inside the analysis
        // context. An inherited private method can not be called inside the
        // $this context.
Severity: Minor
Found in src/Analyse/Callback/Analyse/Objects/Getter.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 retrieveDeclaringClassFromTraits has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function retrieveDeclaringClassFromTraits(
        array $traits,
        ReflectionProperty $refProperty,
        ReflectionClass $originalRef
    ): ?ReflectionClass {
Severity: Minor
Found in src/Analyse/Declaration/PropertyDeclaration.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 retrieveValueStatus has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function retrieveValueStatus(ReflectionProperty $refProperty): string
    {
        $additional = '';

        // There are readonly properties since PHP 8.1 available.
Severity: Minor
Found in src/Analyse/Callback/Iterate/ThroughProperties.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 retrieveValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function retrieveValue(ReflectionProperty $refProperty)
    {
        $propName = $refProperty->getName();
        $classedPropName = "\0" . $refProperty->getDeclaringClass()->getName() . "\0" . $propName;
        $result = null;
Severity: Minor
Found in src/Service/Reflection/ReflectionClass.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 generateDumperList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function generateDumperList(): array
    {
        $ref = $this->parameters[static::PARAM_REF] = new ReflectionClass($this->parameters[static::PARAM_DATA]);
        $config = $this->pool->config;
        $stuffToDump = [PublicProperties::class];
Severity: Minor
Found in src/Analyse/Callback/Analyse/Objects.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