digipolisgent/robo-digipolis-package-drupal8

View on GitHub

Showing 6 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

        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

        Severity
        Category
        Status
        Source
        Language