brainworxx/kreXX-TYPO3-Extension

View on GitHub

Showing 20 of 20 total issues

Method deactivatePlugin has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function deactivatePlugin(string $configClass): void
    {
        if (empty(static::$plugins[$configClass][static::IS_ACTIVE])) {
            // We will not purge everything for an already deactivated plugin.
            return;
Severity: Minor
Found in Resources/Private/krexx/src/Service/Plugin/Registration.php - About 1 hr to fix

    Function handle has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function handle(AbstractCallback $callback, Model $model = null): string
        {
            $output = '';
            /** @var \Brainworxx\Krexx\Service\Reflection\ReflectionClass $reflection */
            $reflection = $callback->getParameters()[static::PARAM_REF];
    Severity: Minor
    Found in Classes/Plugins/AimeosDebugger/EventHandlers/DebugMethods.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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            for (let i = 0; i < elements.length; i++) {
                elements[i].addEventListener('mousedown', this.startDraxx);
            }
    Severity: Minor
    Found in Resources/Private/krexx/src/View/Skins/TypeScript/Draxx.ts and 1 other location - About 35 mins to fix
    Resources/Private/krexx/src/View/Skins/TypeScript/Eventhandler.ts on lines 59..61

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 47.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            for (let i = 0; i < elements.length; i++) {
                elements[i].addEventListener('click', this.handle);
            }
    Resources/Private/krexx/src/View/Skins/TypeScript/Draxx.ts on lines 99..101

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 47.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    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 Resources/Private/krexx/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 assignResultsToModel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function assignResultsToModel(array $values, Model $model, AbstractCallback $callback): void
        {
            $params = $callback->getParameters();
            /** @var \ReflectionMethod $reflectionMethod */
            $reflectionMethod = $params[static::PARAM_ADDITIONAL][static::PARAM_REFLECTION_METHOD];
    Severity: Minor
    Found in Classes/Plugins/AimeosDebugger/EventHandlers/Getter.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 generateComplicatedStuff has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function generateComplicatedStuff(Model $model): string
        {
            // Define a fallback value.
            $result = static::UNKNOWN_VALUE;
    
    
    Severity: Minor
    Found in Resources/Private/krexx/src/Analyse/Code/Codegen.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 processGroups has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function processGroups(array &$moduleSettings): array
        {
            $result = [];
            $validation = Krexx::$pool->config->validation;
    
    
    Severity: Minor
    Found in Classes/Domain/Model/Settings.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 Resources/Private/krexx/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 isAllowedDebugCall has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function isAllowedDebugCall(object $data, string $method): bool
        {
            // Check if the class itself is blacklisted.
            foreach ($this->classBlacklist as $classname) {
                if ($data instanceof $classname) {
    Severity: Minor
    Found in Resources/Private/krexx/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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    <?php
    
    /**
     * kreXX: Krumo eXXtended
     *
    Resources/Private/krexx/src/View/Skins/SmokyGrey/Recursion.php on lines 1..78

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 90.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    <?php
    
    /**
     * kreXX: Krumo eXXtended
     *
    Severity: Minor
    Found in Resources/Private/krexx/src/View/Skins/SmokyGrey/Recursion.php and 1 other location - About 30 mins to fix
    Resources/Private/krexx/src/View/Skins/SmokyGrey/SingleEditableChild.php on lines 1..80

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 90.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    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 || !$this->pool->chunks->isChunkAllowed()) {
                return $this;
    Severity: Minor
    Found in Resources/Private/krexx/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 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 Resources/Private/krexx/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 translateDefaultValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function translateDefaultValue($default)
        {
            if (is_string($default)) {
                $default = '\'' . str_replace('\'', '\\\'', $default) . '\'';
            } elseif (is_array($default)) {
    Severity: Minor
    Found in Resources/Private/krexx/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 getCurrentUrl has a Cognitive Complexity of 6 (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 Resources/Private/krexx/src/Analyse/Caller/AbstractCaller.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 retrieveSql has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function retrieveSql($query): string
        {
            try {
                if ($query instanceof QueryInterface) {
                    $query = GeneralUtility::makeInstance(Typo3DbQueryParser::class)
    Severity: Minor
    Found in Classes/Plugins/Typo3/EventHandlers/QueryDebugger.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 Resources/Private/krexx/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 handleUndeclaredProperties has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function handleUndeclaredProperties(
            array &$refProps,
            $data,
            array $publicProps,
            ReflectionClass $ref

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

        protected function generateName(ReflectionClass $ref): string
        {
            $result = '';
            $messages = $this->pool->messages;
    
    
    Severity: Minor
    Found in Resources/Private/krexx/src/Analyse/Callback/Analyse/Objects/Meta.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