Showing 838 of 1,520 total issues

Function actionDbsettings has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    public function actionDbsettings()
    {
        $this->_markFinished('requirements');

        $dbConfFile = Yii::app()->basePath.'/config/'.'db.php';
Severity: Minor
Found in protected/modules/install/controllers/DefaultController.php - About 5 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 _calculateNonConjunctionResult has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    private function _calculateNonConjunctionResult(Zend_Search_Lucene_Interface $reader)
    {
        $requiredVectors = [];
        $requiredVectorsSizes = [];
        $requiredVectorsIds = []; // is used to prevent arrays comparison

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 35 (exceeds 5 allowed). Consider refactoring.
Open

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

        if ($this->_field === null) {

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

    public function termPositions(Zend_Search_Lucene_Index_Term $term, $shift = 0, $docsFilter = null)
    {
        $termInfo = $this->getTermInfo($term);

        if (!$termInfo instanceof Zend_Search_Lucene_Index_TermInfo) {

    Post has 39 functions (exceeds 20 allowed). Consider refactoring.
    Open

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

      File modulesinstall.php has 375 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * Отображение для modulesinstall:
       *
       * @category YupeView
      Severity: Minor
      Found in protected/modules/install/views/default/modulesinstall.php - About 5 hrs to fix

        Zend_Search_Lucene_Index_SegmentInfo has 38 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Zend_Search_Lucene_Index_SegmentInfo implements Zend_Search_Lucene_Index_TermsStream_Interface
        {
            /**
             * "Full scan vs fetch" boundary.
             *

          Function init has 124 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          listCell.init = function () {
              // Запоминаем текущий объект,
              // так как он не доступен внутри
              // других методов:
              var self = this,
          Severity: Major
          Found in protected/modules/feedback/views/assets/js/feedback.js - About 4 hrs to fix

            File BackendController.php has 372 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * Главный контроллер админ-панели:
             *
             * @category YupeController
            Severity: Minor
            Found in protected/modules/yupe/controllers/BackendController.php - About 4 hrs to fix

              File User.php has 372 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              use yupe\widgets\YPurifier;
              
              /**
               * This is the model class for table "{{user_user}}".
              Severity: Minor
              Found in protected/modules/user/models/User.php - About 4 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 __construct has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

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

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

                <?php
                /* @var $this CartController */
                /* @var $positions Product[] */
                /* @var $order Order */
                /* @var $coupons Coupon[] */
                Severity: Minor
                Found in themes/shop/views/cart/cart/index.php - About 4 hrs to fix

                  Method __construct has 122 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 UserModule.php has 369 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    /**
                     * UserModule основной класс модуля user
                     *
                    Severity: Minor
                    Found in protected/modules/user/UserModule.php - About 4 hrs to fix

                      File index.php has 368 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /* @var $this CartController */
                      /* @var $positions Product[] */
                      /* @var $order Order */
                      /* @var $coupons Coupon[] */
                      Severity: Minor
                      Found in themes/default/views/cart/cart/index.php - About 4 hrs to fix

                        File _form.php has 368 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        /**
                         * Отображение для postBackend/_form:
                         *
                         * @category YupeView
                        Severity: Minor
                        Found in protected/modules/blog/views/postBackend/_form.php - About 4 hrs to fix

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

                              publicMethod.prep = function (object) {
                                  if (!open) {
                                      return;
                                  }
                          
                          

                            Method safeUp has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function safeUp()
                                {
                                    $this->createTable(
                                        '{{dictionary_dictionary_group}}',
                                        [

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

                                  public function actionSitesettings()
                                  {
                                      $model = new InstallForm('siteSettings');
                              
                                      if (isset($this->session['InstallForm']['siteSettings'])) {
                              Severity: Minor
                              Found in protected/modules/install/controllers/DefaultController.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

                              Severity
                              Category
                              Status
                              Source
                              Language