Showing 838 of 1,520 total issues

Function generateActiveGroup has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    public function generateActiveGroup($modelClass, $column)
    {
        if ($column->type === 'boolean') {
            return "\$form->checkBoxGroup(\$model, '{$column->name}', [
            'widgetOptions' =>
Severity: Minor
Found in protected/modules/yupe/extensions/yupe/gii/yupeCrud/YupeCrudCode.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 actionCreate has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    public function actionCreate()
    {
        /**
         * Если это не AJAX-запрос - посылаем:
         **/
Severity: Minor
Found in protected/modules/zendsearch/controllers/ManageBackendController.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

Method find has 114 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function find($query)
    {
        if (is_string($query)) {
            require_once 'Zend/Search/Lucene/Search/QueryParser.php';

Severity: Major
Found in protected/modules/zendsearch/vendors/Zend/Search/Lucene.php - About 4 hrs to fix

    File yupe.php has 356 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Message translations.
     *
     * This file is automatically generated by 'yiic message' command.
    Severity: Minor
    Found in protected/modules/yupe/messages/ru/yupe.php - About 4 hrs to fix

      File store.php has 356 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      return [
          '% to the price' => '% к цене',
          '*unknown*' => '*неизвестно*',
          '--choose--' => '--выберите--',
      Severity: Minor
      Found in protected/modules/store/messages/ru/store.php - About 4 hrs to fix

        File user.php has 356 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * Message translations.
         *
         * This file is automatically generated by 'yiic message' command.
        Severity: Minor
        Found in protected/modules/user/messages/ru/user.php - About 4 hrs to fix

          File DCategoryTreeBehavior.php has 356 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          namespace store\components\behaviors;
          
          use Yii;
          
          

            File MultiTerm.php has 356 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * Zend Framework
             *
             * LICENSE

              Method actionEnvironment has 112 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function actionEnvironment()
                  {
              
                      $webRoot = Yii::getPathOfAlias('webroot');
                      $app = Yii::getPathOfAlias('application');
              Severity: Major
              Found in protected/modules/install/controllers/DefaultController.php - About 4 hrs to fix

                File store.js has 352 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                $(document).ajaxError(function () {
                    $('#notifications').notify({message: {text: 'Произошла ошибка =('}, 'type': 'danger'}).show();
                });
                
                $(document).ready(function () {
                Severity: Minor
                Found in themes/default/web/js/store.js - About 4 hrs to fix

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

                      public function run()
                      {
                          $user = $this->getController()->user;
                  
                          $form = new ProfileForm();
                  Severity: Minor
                  Found in protected/modules/user/controllers/profile/ProfileAction.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

                  Method rewrite has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function rewrite(Zend_Search_Lucene_Interface $index)
                      {
                          if ($this->_field === null) {
                              require_once 'Zend/Search/Lucene/Search/Query/MultiTerm.php';
                              $query = new Zend_Search_Lucene_Search_Query_MultiTerm();

                    Function prep has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        publicMethod.prep = function (object) {
                            if (!open) {
                                return;
                            }
                            
                    Severity: Major
                    Found in protected/modules/image/widgets/colorbox/assets/js/jquery.colorbox.js - About 4 hrs to fix

                      Method rewrite has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function rewrite(Zend_Search_Lucene_Interface $index)
                          {
                              $this->_matches = [];
                              $this->_scores = [];
                              $this->_termKeys = [];

                        Blog has 34 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Blog extends yupe\models\YModel
                        {
                            /**
                             *
                             */
                        Severity: Minor
                        Found in protected/modules/blog/models/Blog.php - About 4 hrs to fix

                          File QueryLexer.php has 346 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          /**
                           * Zend Framework
                           *
                           * LICENSE

                            Function replaceLangInUrl has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function replaceLangInUrl($url, $lang = null)
                                {
                                    $parsed = parse_url($url);
                            
                                    $result = '';
                            Severity: Minor
                            Found in protected/modules/yupe/components/urlManager/LangUrlManager.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

                            Method actionSitesettings has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function actionSitesettings()
                                {
                                    $model = new InstallForm('siteSettings');
                            
                                    if (isset($this->session['InstallForm']['siteSettings'])) {
                            Severity: Major
                            Found in protected/modules/install/controllers/DefaultController.php - About 4 hrs to fix

                              Method checkForBadMigration has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function checkForBadMigration($module, $class = false)
                                  {
                                      echo Yii::t('YupeModule.yupe', "Checking for pending migrations").'<br />';
                              
                                      $db = $this->getDbConnection();
                              Severity: Major
                              Found in protected/modules/yupe/components/Migrator.php - About 4 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language