TikiWiki/tiki-manager

View on GitHub

Showing 2,255 of 2,255 total issues

Identical blocks of code found in 3 locations. Consider refactoring.
Open

        for ($i = 0, $tmp_count = strlen($login); $i < $tmp_count; $i++, $key++) {
            $next = ord($login[$i]) + $key;
            if ($next > 255) {
                $next -= 255;
            } elseif ($next < 0) {
Severity: Minor
Found in src/Ext/Password.php and 2 other locations - About 40 mins to fix
src/Ext/Password.php on lines 320..335
src/Ext/Password.php on lines 388..403

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 93.

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

Identical blocks of code found in 3 locations. Consider refactoring.
Open

        for ($i = 0, $tmp_count = strlen($login); $i < $tmp_count; $i++) {
            $next = ord($login[$i]) + $key;
            if ($next > 255) {
                $next -= 255;
            } elseif ($next < 0) {
Severity: Minor
Found in src/Ext/Password.php and 2 other locations - About 40 mins to fix
src/Ext/Password.php on lines 354..369
src/Ext/Password.php on lines 388..403

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 93.

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

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct(Instance $instance, bool $direct = false, bool $onlyData = false, bool $skipSystemConfigurationCheck = false, $allowCommonParents = 0)
Severity: Minor
Found in src/Application/Restore.php - About 35 mins to fix

    Method registerAccessMethod has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function registerAccessMethod($type, $host, $user, $password = null, $port = null)
    Severity: Minor
    Found in src/Application/Instance.php - About 35 mins to fix

      Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function __construct(string $name, string $version, SoftwareRequirement $phpVersion, SoftwareRequirement $mysqlVersion, SoftwareRequirement $mariaDBVersion)
      Severity: Minor
      Found in src/Application/Tiki/Versions/TikiRequirements.php - About 35 mins to fix

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

        <?php
        /**
         * @copyright (c) Copyright by authors of the Tiki Manager Project. All Rights Reserved.
         *     See copyright.txt for details and a complete list of authors.
         * @licence Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See LICENSE for details.
        Severity: Minor
        Found in src/Hooks/InstanceBackupHook.php and 1 other location - About 35 mins to fix
        src/Hooks/InstanceUpgradeHook.php on lines 1..26

        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 92.

        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
        /**
         * @copyright (c) Copyright by authors of the Tiki Manager Project. All Rights Reserved.
         *     See copyright.txt for details and a complete list of authors.
         * @licence Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See LICENSE for details.
        Severity: Minor
        Found in src/Hooks/InstanceUpgradeHook.php and 1 other location - About 35 mins to fix
        src/Hooks/InstanceBackupHook.php on lines 1..26

        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 92.

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

            protected function execute(InputInterface $input, OutputInterface $output)
            {
                $instances = CommandHelper::getInstances('tiki');
                $instancesInfo = CommandHelper::getInstancesInfo($instances);
        
        
        Severity: Minor
        Found in src/Command/ListPatchCommand.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 remove has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            private function remove($helper, $input, $output)
            {
                $report = new ReportManager;
                $instances = $report->getReportInstances();
                $instancesInfo = CommandHelper::getInstancesInfo($instances);
        Severity: Minor
        Found in src/Command/ReportManagerCommand.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 modify has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            private function modify($helper, $input, $output)
            {
                $report = new ReportManager;
                $instances = $report->getReportInstances();
                $instancesInfo = CommandHelper::getInstancesInfo($instances);
        Severity: Minor
        Found in src/Command/ReportManagerCommand.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

            protected function execute(InputInterface $input, OutputInterface $output)
            {
                $instance = new Instance();
                try {
                    if ($input->isInteractive()) {
        Severity: Minor
        Found in src/Command/ImportInstanceCommand.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 decompressArchive has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function decompressArchive($folder, $archive)
            {
                $access = $this->access;
        
                $bzipStep = false;
        Severity: Minor
        Found in src/Application/Restore.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 install has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function install(Version $version, $checksumCheck = false, $revision = null)
            {
                $access = $this->instance->getBestAccess('scripting');
                $host = $access->getHost();
        
        
        Severity: Minor
        Found in src/Application/Tiki.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 createMultipleFromLogin has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function createMultipleFromLogin($login, $type, $key = 0)
            {
                $passwords = [];
                $number    = count($login);
                $save      = $number;
        Severity: Minor
        Found in src/Ext/Password.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 getInstances has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getInstances($exclude_blank = false)
            {
                $result = query(self::SQL_SELECT_INSTANCE);
        
                $instances = [];
        Severity: Minor
        Found in src/Application/Instance.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 updateInstanceTo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function updateInstanceTo($path, $branch)
            {
                $info = $this->info($path);
                $root = $info['repository']['root'];
                $url = $info['url'];
        Severity: Minor
        Found in src/Repository/SVN.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 createMultiple has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function createMultiple($number, $length = 10, $type = 'pronounceable', $chars = '')
            {
                $passwords = [];
        
                while ($number > 0) {
        Severity: Minor
        Found in src/Ext/Password.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 getFileLocations has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getFileLocations()
            {
                $access = $this->instance->getBestAccess('scripting');
                $webroot = rtrim($this->instance->webroot, '/');
                $out = $access->runPHP(
        Severity: Minor
        Found in src/Application/Tiki.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 createTempPartial has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            private function createTempPartial($root, $files)
            {
                $fileSystem = new Filesystem();
                $temp = implode(
                    \DIRECTORY_SEPARATOR,
        Severity: Minor
        Found in src/Application/Backup.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 getApplications has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getApplications(Instance $instance)
            {
                $objects = [];
        
                $dir = __DIR__;
        Severity: Minor
        Found in src/Application/Application.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

        Severity
        Category
        Status
        Source
        Language