Showing 838 of 1,520 total issues

File Comment.php has 320 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
use yupe\widgets\YPurifier;

/**
 * Comment model class:
Severity: Minor
Found in protected/modules/comment/models/Comment.php - About 3 hrs to fix

    Function liTranslit has 92 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    jQuery.fn.liTranslit = function(options){
        // настройки по умолчанию
        var o = jQuery.extend({
            elName: '.s_name',        //Класс елемента с именем
            elAlias: '.s_alias'        //Класс елемента с алиасом
    Severity: Major
    Found in themes/default/web/js/jquery.li-translit.js - About 3 hrs to fix

      Method getNavigation has 92 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getNavigation()
          {
              return [
                  [
                      'icon' => 'fa fa-fw fa-reorder',
      Severity: Major
      Found in protected/modules/store/StoreModule.php - About 3 hrs to fix

        Method skipTo has 92 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function skipTo(Zend_Search_Lucene_Index_Term $prefix)
            {
                if ($this->_termDictionary === null) {
                    $this->_loadDictionaryIndex();
                }

          Method termFreqs has 92 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function termFreqs(Zend_Search_Lucene_Index_Term $term, $shift = 0, $docsFilter = null)
              {
                  $termInfo = $this->getTermInfo($term);
          
                  if (!$termInfo instanceof Zend_Search_Lucene_Index_TermInfo) {

            Method addDocument has 91 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function addDocument(Zend_Search_Lucene_Document $document)
                {
                    /** Zend_Search_Lucene_Search_Similarity */
                    require_once 'Zend/Search/Lucene/Search/Similarity.php';
            
            

              Function __construct has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function __construct($tokenCategory, $tokenText, $position)
                  {
                      $this->text = $tokenText;
                      $this->position = $position + 1; // Start from 1
              
              

              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

              File yupe.php has 315 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/zh/yupe.php - About 3 hrs to fix

                File yupe.php has 315 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/en/yupe.php - About 3 hrs to fix

                  File ProductRepository.php has 313 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  /**
                   * Class ProductRepository
                   */
                  Severity: Minor
                  Found in protected/modules/store/components/repository/ProductRepository.php - About 3 hrs to fix

                    Comment has 29 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Comment extends yupe\models\YModel
                    {
                        /**
                         *
                         */
                    Severity: Minor
                    Found in protected/modules/comment/models/Comment.php - About 3 hrs to fix

                      File ProductBackendController.php has 312 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      /**
                       * Class ProductBackendController
                       */
                      Severity: Minor
                      Found in protected/modules/store/controllers/ProductBackendController.php - About 3 hrs to fix

                        Method getTermInfo has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function getTermInfo(Zend_Search_Lucene_Index_Term $term)
                            {
                                $termKey = $term->key();
                                if (isset($this->_termInfoCache[$termKey])) {
                                    $termInfo = $this->_termInfoCache[$termKey];

                          Method __construct has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function __construct(
                                  Zend_Search_Lucene_Storage_Directory $directory,
                                  $name,
                                  $docCount,
                                  $delGen = 0,

                            File view.php has 310 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            
                            /* @var $product Product */
                            
                            $this->title = $product->getMetaTitle();
                            Severity: Minor
                            Found in themes/shop/views/store/product/view.php - About 3 hrs to fix

                              Method mergeSettings has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function mergeSettings($settings = [])
                                  {
                              
                                      $this->_config = CMap::mergeArray(
                                          $this->_base,
                              Severity: Major
                              Found in protected/modules/yupe/components/ConfigManager.php - About 3 hrs to fix

                                Method actionCreate has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function actionCreate()
                                    {
                                        /**
                                         * Если это не AJAX-запрос - посылаем:
                                         **/
                                Severity: Major
                                Found in protected/modules/zendsearch/controllers/ManageBackendController.php - About 3 hrs to fix

                                  Function actionCreate has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function actionCreate()
                                      {
                                          $model = new Page();
                                          $menuId = null;
                                          $menuParentId = 0;
                                  Severity: Minor
                                  Found in protected/modules/page/controllers/PageBackendController.php - About 3 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 actionModuleStatus has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function actionModuleStatus()
                                      {
                                          if (!Yii::app()->getRequest()->getIsPostRequest() || !Yii::app()->getRequest()->getIsAjaxRequest()) {
                                              throw new CHttpException(404, Yii::t('YupeModule.yupe', 'Page was not found!'));
                                          }
                                  Severity: Minor
                                  Found in protected/modules/yupe/controllers/ModulesBackendController.php - About 3 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 getModulesDisabled has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function getModulesDisabled($enableModule = [])
                                      {
                                          if (($imports = Yii::app()->getCache()->get('pathForImports')) !== false) {
                                              Yii::app()->getModule('yupe')->setImport($imports);
                                          }
                                  Severity: Minor
                                  Found in protected/modules/yupe/components/ModuleManager.php - About 3 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language