Showing 838 of 1,520 total issues

File BlogModule.php has 339 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * BlogModule основной класс модуля blog
 *
 * @author yupe team <support@yupe.ru>
Severity: Minor
Found in protected/modules/blog/BlogModule.php - About 4 hrs to fix

    Function _booleanExpressionQuery has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

        private function _booleanExpressionQuery()
        {
            /**
             * We treat each level of an expression as a boolean expression in
             * a Disjunctive Normal Form

    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 __construct has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

        private function __construct($fileName, $storeContent)
        {
            if (!class_exists('ZipArchive', false)) {
                require_once 'Zend/Search/Lucene/Exception.php';
                throw new Zend_Search_Lucene_Exception('MS Office documents processing functionality requires Zip extension to be loaded');

    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 CustomGridView.php has 335 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     *   Widget CustomGridView
     *
     * @category Widgets
    Severity: Minor
    Found in protected/modules/yupe/widgets/CustomGridView.php - About 4 hrs to fix

      Consider simplifying this complex logical expression.
      Open

              if ($) {
                  var s, d = "none" === O.transition ? 0 : O.speed;
                  W.empty().remove(), W = o(se, "LoadedContent").append(i), W.hide().appendTo(F.show()).css({width: n(), overflow: O.scrolling ? "auto" : "hidden"}).css({height: l()}).prependTo(x), F.hide(), t(U).css({"float": "none"}), s = function () {
                      function i() {
                          t.support.opacity === !1 && v[0].style.removeAttribute("filter")

        YupeModule has 32 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class YupeModule extends WebModule
        {
            /**
             *
             */
        Severity: Minor
        Found in protected/modules/yupe/YupeModule.php - About 4 hrs to fix

          File user.php has 332 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/en/user.php - About 4 hrs to fix

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

              Function moduleRow has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

              function moduleRow($module, &$updates, &$modules)
              {
                  ?>
                  <tr class="<?= ($module->getIsActive()) ? (is_array(
                      $module->checkSelf()
              Severity: Minor
              Found in protected/modules/yupe/views/backend/_moduleslist.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 rewrite has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

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

              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 _dumpTermDictEntry has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function _dumpTermDictEntry(
                      Zend_Search_Lucene_Storage_File $dicFile,
                      &$prevTerm,
                      Zend_Search_Lucene_Index_Term $term,
                      &$prevTermInfo,

              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 load has 97 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function load () {
                      var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
                      
                      active = true;
                      
              Severity: Major
              Found in protected/modules/image/widgets/colorbox/assets/js/jquery.colorbox.js - About 3 hrs to fix

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

                    private function __construct($fileName, $storeContent)
                    {
                        if (!class_exists('ZipArchive', false)) {
                            require_once 'Zend/Search/Lucene/Exception.php';
                            throw new Zend_Search_Lucene_Exception('MS Office documents processing functionality requires Zip extension to be loaded');

                  File Similarity.php has 327 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

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

                    Method actionModulesinstall has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function actionModulesinstall()
                        {
                            set_time_limit(180);
                    
                            $error = false;
                    Severity: Major
                    Found in protected/modules/install/controllers/DefaultController.php - About 3 hrs to fix

                      Function load has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function load() {
                              var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
                      
                              active = true;
                      
                      

                        Function liTranslit has 95 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 protected/modules/yupe/views/assets/js/jquery.li-translit.js - About 3 hrs to fix

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

                              public function actionCreate()
                              {
                                  $model = new Page();
                                  $menuId = null;
                                  $menuParentId = 0;
                          Severity: Major
                          Found in protected/modules/page/controllers/PageBackendController.php - About 3 hrs to fix

                            Function rmDir has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public static function rmDir($path)
                                {
                                    static $doNotRemoveBaseDirectory = false, $baseDirectory;
                            
                                    $path = trim($path);
                            Severity: Minor
                            Found in protected/modules/yupe/helpers/YFile.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

                            Method checkSelf has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function checkSelf()
                                {
                                    $messages = [];
                            
                                    if (Yii::app()->hasModule('install')) {
                            Severity: Major
                            Found in protected/modules/yupe/YupeModule.php - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language