digipolisgent/robo-digipolis-laravel

View on GitHub

Showing 26 of 26 total issues

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

<?php

namespace DigipolisGent\Robo\Laravel\Robo\Plugin\Commands;

use Consolidation\AnnotatedCommand\Events\CustomEventAwareInterface;
Severity: Major
Found in src/Robo/Plugin/Commands/DigipolisLaravelUpdateCommand.php and 1 other location - About 1 hr to fix
src/Robo/Plugin/Commands/DigipolisLaravelInstallCommand.php on lines 1..32

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

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

namespace DigipolisGent\Robo\Laravel\Robo\Plugin\Commands;

use Consolidation\AnnotatedCommand\Events\CustomEventAwareInterface;
Severity: Major
Found in src/Robo/Plugin/Commands/DigipolisLaravelInstallCommand.php and 1 other location - About 1 hr to fix
src/Robo/Plugin/Commands/DigipolisLaravelUpdateCommand.php on lines 1..36

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

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 digipolisSyncLaravel has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $sourceUser,
        $sourceHost,
        $sourceKeyFile,
        $destinationUser,
        $destinationHost,
Severity: Major
Found in src/Robo/Plugin/Commands/DigipolisLaravelSyncCommand.php - About 1 hr to fix

    Each class must be in a namespace of at least one level (a top-level vendor name)
    Open

    class RoboFile extends Tasks
    Severity: Minor
    Found in src/RoboFile.php by phpcodesniffer

    The closing brace for the class must go on the next line after the body
    Open

    }

    The closing brace for the class must go on the next line after the body
    Open

    }

    The closing brace for the class must go on the next line after the body
    Open

    }

    There must be one blank line after the last USE statement; 2 found;
    Open

    use Symfony\Component\Finder\Finder;

    Expected 1 blank line at end of file; 2 found
    Open

    }

    Avoid unused local variables such as '$options'.
    Open

            $options = $event->getArgument('options');
    Severity: Minor
    Found in src/EventHandler/InstallHandler.php by phpmd

    UnusedLocalVariable

    Since: 0.2

    Detects when a local variable is declared and/or assigned, but not used.

    Example

    class Foo {
        public function doSomething()
        {
            $i = 5; // Unused
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

    Line exceeds 120 characters; contains 129 characters
    Open

            $collection->taskSsh($remoteConfig->getHost(), new KeyFile($remoteConfig->getUser(), $remoteConfig->getPrivateKeyFile()))

    Line exceeds 120 characters; contains 129 characters
    Open

            $collection->taskSsh($remoteConfig->getHost(), new KeyFile($remoteConfig->getUser(), $remoteConfig->getPrivateKeyFile()))

    Line exceeds 120 characters; contains 129 characters
    Open

            $collection->taskSsh($remoteConfig->getHost(), new KeyFile($remoteConfig->getUser(), $remoteConfig->getPrivateKeyFile()))

    Opening brace should be on a new line
    Open

        public function digipolisInstallLaravel() {

    Line length
    Open

    digipolis:download-backup-laravel  Download a backup of files (storage folder) and database.
    Severity: Info
    Found in README.md by markdownlint

    MD013 - Line length

    Tags: line_length

    Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

    This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

    This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

    You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

    Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

    Line length
    Open

    digipolis:switch-previous          Switch the current release symlink to the previous release.
    Severity: Info
    Found in README.md by markdownlint

    MD013 - Line length

    Tags: line_length

    Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

    This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

    This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

    You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

    Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

    Line length
    Open

    digipolis:sync-laravel             Sync the database and files between two Laravel sites.
    Severity: Info
    Found in README.md by markdownlint

    MD013 - Line length

    Tags: line_length

    Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

    This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

    This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

    You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

    Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

    Line length
    Open

    digipolis:update-laravel           Executes database updates of the Laravel site in the current folder.
    Severity: Info
    Found in README.md by markdownlint

    MD013 - Line length

    Tags: line_length

    Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

    This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

    This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

    You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

    Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

    Opening brace should be on a new line
    Open

        public function getPriority(): int {

    Opening brace should be on a new line
    Open

        public function getPriority(): int {
    Severity
    Category
    Status
    Source
    Language