digipolisgent/robo-digipolis-package-drupal8

View on GitHub

Showing 11 of 11 total issues

Method run has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function run()
    {
        $themesFromConfig = $this->getConfig()->get('digipolis.themes.drupal8', false);
        $themeNamesFromConfig = [];
        if ($themesFromConfig) {
Severity: Minor
Found in src/ThemesCleanDrupal8.php - About 1 hr to fix

    Method run has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function run()
        {
            $themes = empty($this->themes)
                ? $this->getConfig()->get('digipolis.themes.drupal8', false)
                : $this->themes;
    Severity: Minor
    Found in src/ThemesCompileDrupal8.php - About 1 hr to fix

      Method getThemePaths has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function getThemePaths($themes)
          {
              $dirsFromConfig = array_filter(
                  [
                      $this->getConfig()->get('digipolis.root.project', false),
      Severity: Minor
      Found in src/Utility/ThemeFinder.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 \Robo\Tasks
        Severity: Minor
        Found in RoboFile.php by phpcodesniffer

        Function run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public function run()
            {
                $themesFromConfig = $this->getConfig()->get('digipolis.themes.drupal8', false);
                $themeNamesFromConfig = [];
                if ($themesFromConfig) {
        Severity: Minor
        Found in src/ThemesCleanDrupal8.php - About 55 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 run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function run()
            {
                $themes = empty($this->themes)
                    ? $this->getConfig()->get('digipolis.themes.drupal8', false)
                    : $this->themes;
        Severity: Minor
        Found in src/ThemesCompileDrupal8.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 getThemePaths has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function getThemePaths($themes)
            {
                $dirsFromConfig = array_filter(
                    [
                        $this->getConfig()->get('digipolis.root.project', false),
        Severity: Minor
        Found in src/Utility/ThemeFinder.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

        Avoid unused parameters such as '$io'.
        Open

            public function digipolisPackageDrupal8(ConsoleIO $io, $archiveFile, $dir = null, $opts = ['ignore|i' => ''])

        UnusedFormalParameter

        Since: 0.2

        Avoid passing parameters to methods or constructors and then not using those parameters.

        Example

        class Foo
        {
            private function bar($howdy)
            {
                // $howdy is not used
            }
        }

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

        Avoid unused parameters such as '$io'.
        Open

            public function digipolisThemesCompileDrupal8(ConsoleIO $io, $themes = '', $dirs = '')

        UnusedFormalParameter

        Since: 0.2

        Avoid passing parameters to methods or constructors and then not using those parameters.

        Example

        class Foo
        {
            private function bar($howdy)
            {
                // $howdy is not used
            }
        }

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

        Avoid unused parameters such as '$io'.
        Open

            public function digipolisThemesCleanDrupal8(ConsoleIO $io, $themes = '', $dirs = '')

        UnusedFormalParameter

        Since: 0.2

        Avoid passing parameters to methods or constructors and then not using those parameters.

        Example

        class Foo
        {
            private function bar($howdy)
            {
                // $howdy is not used
            }
        }

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

        Line exceeds 120 characters; contains 139 characters
        Open

        class DigipolisPackageDrupal8Commands extends \Robo\Tasks implements DigipolisPropertiesAwareInterface, \Robo\Contract\ConfigAwareInterface
        Severity
        Category
        Status
        Source
        Language