qcubed/framework

View on GitHub

Showing 2,378 of 15,774 total issues

File QDialogBase.class.php has 302 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
    /**
     * Dialog Base Class
     * 
     * The QDialogBase class defined here provides an interface between the generated
Severity: Minor
Found in includes/base_controls/QDialogBase.class.php - About 3 hrs to fix

    Function _keydown has 81 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _keydown: function( event ) {
            var match, prev, character, skip, regex,
                preventDefault = true;
    
            function escape( value ) {
    Severity: Major
    Found in assets/js/jquery/jquery-ui.custom.js - About 3 hrs to fix

      Method __set has 81 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public function __set($strName, $mixValue) {
                  try {
                      switch ($strName) {
                          case 'Month':
                              if ($this->blnDateNull && (!is_null($mixValue)))
      Severity: Major
      Found in includes/framework/QDateTime.class.php - About 3 hrs to fix

        Method __set has 81 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public function __set($strName, $mixValue) {
                    switch ($strName) {
                        case 'Accept':
                            $this->mixAccept = $mixValue;
                            $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'accept', $mixValue);
        Severity: Major
        Found in includes/base_controls/QDroppableGen.class.php - About 3 hrs to fix

          Method AnalyzeDatabase has 81 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  protected function AnalyzeDatabase() {
                      if (!QApplication::$Database) {
                          $this->strErrors = 'FATAL ERROR: No databases are listed in the configuration file.';
                          return;
                      }
          Severity: Major
          Found in includes/codegen/QDatabaseCodeGen.class.php - About 3 hrs to fix

            Method Form_Create has 80 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    protected function Form_Create() {
                        $strServerActionJsParam = "";
            
                        $this->btnSubmit = new QButton($this);
                        $this->btnSubmit->Text = "ServerAction Submit";
            Severity: Major
            Found in assets/php/examples/other_controls/js_return_param_example.php - About 3 hrs to fix

              File QHtmlTable_CodeGenerator.class.php has 299 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * This is a base class to support classes that are derived from QHtmlTable. The methods here support the use
               * of QHtmlTable derived classes as a list connector, something that displays a list of records from a database,
               * and optionally allows the user to do CRUD operations on individual records.
              Severity: Minor
              Found in includes/codegen/controls/QHtmlTable_CodeGenerator.class.php - About 3 hrs to fix

                QMenuGen has 27 functions (exceeds 20 allowed). Consider refactoring.
                Open

                    class QMenuGen extends QPanel    {
                        protected $strJavaScripts = __JQUERY_EFFECTS__;
                        protected $strStyleSheets = __JQUERY_CSS__;
                        /** @var boolean */
                        protected $blnDisabled = null;
                Severity: Minor
                Found in includes/base_controls/QMenuGen.class.php - About 3 hrs to fix

                  QDatabaseCodeGen has 27 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                      class QDatabaseCodeGen extends QCodeGen {
                          public $objSettingsXml;    // Make public so templates can use it directly.
                  
                          // Objects
                          /** @var array|QSqlTable[] Array of tables in the database */
                  Severity: Minor
                  Found in includes/codegen/QDatabaseCodeGen.class.php - About 3 hrs to fix

                    Function Qcubed__DateTimePicker_Change has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function Qcubed__DateTimePicker_Change(strControlId, objListbox) {
                        var objMonth = document.getElementById(strControlId + "_lstMonth"),
                            objDay = document.getElementById(strControlId + "_lstDay"),
                            objYear = document.getElementById(strControlId + "_lstYear"),
                            intCurrentDay,
                    Severity: Major
                    Found in assets/js/date_time_picker.js - About 3 hrs to fix

                      Function _open has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _open: function( event, target, content ) {
                              var tooltip, events, delayedShow, a11yContent,
                                  positionOption = $.extend( {}, this.options.position );
                      
                              if ( !content ) {
                      Severity: Major
                      Found in assets/js/jquery/jquery-ui.custom.js - About 3 hrs to fix

                        Function formatDate has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            formatDate: function (format, date, settings) {
                                if (!date) {
                                    return "";
                                }
                        
                        
                        Severity: Major
                        Found in assets/js/jquery/jquery-ui.custom.js - About 3 hrs to fix

                          Method CastValueTo has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  private static function CastValueTo($mixItem, $strNewType) {
                                      $strOriginalType = gettype($mixItem);
                          
                                      switch (QType::TypeFromDoc($strNewType)) {
                                          case QType::Boolean:
                          Severity: Major
                          Found in includes/framework/QType.class.php - About 3 hrs to fix

                            Function postAjax has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                postAjax: function(strForm, strControl, strEvent, mixParameter, strWaitIconControlId, blnAsync) {
                                    var objForm = $j('#' + strForm),
                                        strFormAction = objForm.attr("action"),
                                        qFormParams = {};
                            
                            
                            Severity: Major
                            Found in assets/js/qcubed.js - About 3 hrs to fix

                              Method testExample has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function testExample() {
                                      $objPersonArray = Person::QueryArray(
                                          /* Only return the persons who have AT LEAST ONE overdue project */
                                          QQ::GreaterThan(QQ::Sub(QQN::Person()->ProjectAsManager->Spent, QQN::Person()->ProjectAsManager->Budget), 20)
                                      );
                              Severity: Major
                              Found in includes/tests/qcubed-unit/QQMathOpTest.php - About 3 hrs to fix

                                File QFileAssetBase.class.php has 296 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                <?php
                                    /**
                                     * This file contains the QFileAssetBase class.
                                     *
                                     * @package Controls
                                Severity: Minor
                                Found in includes/base_controls/QFileAssetBase.class.php - About 3 hrs to fix

                                  Function CollapseNodes has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                          protected function CollapseNodes($mixParameterArray) {
                                              /** @var QQNode[] $objNodeArray */
                                              $objNodeArray = array();
                                              foreach ($mixParameterArray as $mixParameter) {
                                                  if (is_array($mixParameter)) {
                                  Severity: Minor
                                  Found in includes/framework/QQuery.class.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 GetHeaderRowHtml has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      protected function GetHeaderRowHtml() {
                                          $strToReturn = '';
                                          for ($i = 0; $i < $this->intHeaderRowCount; $i++) {
                                              $this->intCurrentHeaderRowIndex = $i;
                                  
                                  
                                  Severity: Minor
                                  Found in includes/base_controls/QDataGridBase.class.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 SetSelectedItemsByValue has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                          public function SetSelectedItemsByValue(array $mixValueArray, $blnRefresh = true) {
                                              $intCount = $this->GetItemCount();
                                  
                                              for ($intIndex = 0; $intIndex < $intCount; $intIndex++) {
                                                  $objItem = $this->GetItem($intIndex);
                                  Severity: Minor
                                  Found in includes/base_controls/QListControl.class.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 __set has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                          public function __set($strName, $mixValue) {
                                              switch ($strName) {
                                                  case 'MaxDate':
                                                  case 'Maximum':
                                                      if (is_string($mixValue)) {
                                  Severity: Minor
                                  Found in includes/base_controls/QDatepickerBase.class.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