protected/modules/yupe/components/WebModule.php

Summary

Maintainability
F
5 days
Test Coverage

File WebModule.php has 607 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * WebModule - базовый класс для всех модулей Юпи!
 *
 * Все модули, разработанные для Юпи! должны наследовать этот класс.
Severity: Major
Found in protected/modules/yupe/components/WebModule.php - About 1 day to fix

    WebModule has 53 functions (exceeds 20 allowed). Consider refactoring.
    Open

    abstract class WebModule extends CWebModule
    {
        /**
         *
         */
    Severity: Major
    Found in protected/modules/yupe/components/WebModule.php - About 7 hrs to fix

      Function getActivate has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getActivate($noDependent = false)
          {
              Yii::app()->getCache()->flush();
              Yii::app()->configManager->flushDump();
      
      
      Severity: Minor
      Found in protected/modules/yupe/components/WebModule.php - About 4 hrs 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 getDeActivate has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getDeActivate($noDependent = false)
          {
              Yii::app()->getCache()->flush();
              Yii::app()->configManager->flushDump();
      
      
      Severity: Minor
      Found in protected/modules/yupe/components/WebModule.php - About 4 hrs 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 installDB has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public function installDB($installed = [])
          {
              $log = [];
              Yii::log(
                  Yii::t(
      Severity: Minor
      Found in protected/modules/yupe/components/WebModule.php - About 2 hrs 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

      Method uninstallDB has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function uninstallDB()
          {
              Yii::log(
                  Yii::t(
                      'YupeModule.yupe',
      Severity: Major
      Found in protected/modules/yupe/components/WebModule.php - About 2 hrs to fix

        Method installDB has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function installDB($installed = [])
            {
                $log = [];
                Yii::log(
                    Yii::t(
        Severity: Minor
        Found in protected/modules/yupe/components/WebModule.php - About 1 hr to fix

          Method getDeActivate has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getDeActivate($noDependent = false)
              {
                  Yii::app()->getCache()->flush();
                  Yii::app()->configManager->flushDump();
          
          
          Severity: Minor
          Found in protected/modules/yupe/components/WebModule.php - About 1 hr to fix

            Method getIsInstalled has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getIsInstalled()
                {
                    $modulesInstalled = Yii::app()->getCache()->get('YupeModulesInstalled');
            
                    if ($modulesInstalled === false) {
            Severity: Minor
            Found in protected/modules/yupe/components/WebModule.php - About 1 hr to fix

              Method getActivate has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getActivate($noDependent = false)
                  {
                      Yii::app()->getCache()->flush();
                      Yii::app()->configManager->flushDump();
              
              
              Severity: Minor
              Found in protected/modules/yupe/components/WebModule.php - About 1 hr to fix

                Function uninstallDB has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function uninstallDB()
                    {
                        Yii::log(
                            Yii::t(
                                'YupeModule.yupe',
                Severity: Minor
                Found in protected/modules/yupe/components/WebModule.php - About 1 hr 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

                Method getSettings has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getSettings($needReset = false)
                    {
                        if ($needReset) {
                            Yii::app()->getCache()->clear($this->getId());
                        }
                Severity: Minor
                Found in protected/modules/yupe/components/WebModule.php - About 1 hr to fix

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

                      public function getSettings($needReset = false)
                      {
                          if ($needReset) {
                              Yii::app()->getCache()->clear($this->getId());
                          }
                  Severity: Minor
                  Found in protected/modules/yupe/components/WebModule.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

                  Function getDependenciesAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getDependenciesAll()
                      {
                          $modulesDependent = Yii::app()->getCache()->get('YupeModulesDependenciesAll');
                          if ($modulesDependent === false) {
                              $modules = Yii::app()->moduleManager->getModules(false, true);
                  Severity: Minor
                  Found in protected/modules/yupe/components/WebModule.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 getModulesNoDisable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getModulesNoDisable()
                      {
                          $modulesNoDisable = Yii::app()->getCache()->get('YupeModulesNoDisable');
                          if ($modulesNoDisable === false) {
                              $modules = Yii::app()->moduleManager->getModules(false, true);
                  Severity: Minor
                  Found in protected/modules/yupe/components/WebModule.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 getDependents has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getDependents()
                      {
                          $modulesDependent = Yii::app()->getCache()->get('YupeModulesDependent');
                          if ($modulesDependent === false) {
                              $modules = $this->getDependenciesAll();
                  Severity: Minor
                  Found in protected/modules/yupe/components/WebModule.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

                  There are no issues that match your filters.

                  Category
                  Status