qcubed/framework

View on GitHub

Showing 2,378 of 15,774 total issues

Function GetValue has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

        public static function GetValue($mixValue, QQueryBuilder $objBuilder, $blnEqualityType = null) {
            if ($mixValue instanceof QQNamedValue) {
                /** @var QQNamedValue $mixValue */
                return $mixValue->Parameter($blnEqualityType);
            }
Severity: Minor
Found in includes/framework/QQuery.class.php - About 2 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 GetDataGridHtml has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

        public function GetDataGridHtml() {
            // Array-ify Node Hierarchy
            $objNodeArray = array();

            $objNodeArray[] = $this;
Severity: Minor
Found in includes/framework/QQuery.class.php - About 2 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 RenderButtonTable has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

        public function RenderButtonTable() {
            $strToReturn = '';
            if ($this->ItemCount > 0) {
                // Figure out the number of ROWS for this table
                $intRowCount = floor($this->ItemCount / $this->intRepeatColumns);
Severity: Minor
Found in includes/base_controls/QCheckBoxList.class.php - About 2 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 GenerateFile has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

        public function GenerateFile($strModuleSubPath, $strTemplateFilePath, $mixArgumentArray, $blnSave = true) {
            // Setup Debug/Exception Message
            if (QCodeGen::DebugMode) _p("Evaluating $strTemplateFilePath<br/>", false);

            // Check to see if the template file exists, and if it does, Load It
Severity: Minor
Found in includes/codegen/QCodeGenBase.class.php - About 2 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 ConnectorCreateOptions has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

        public function ConnectorCreateOptions(QCodeGenBase $objCodeGen, QSqlTable $objTable, $objColumn, $strControlVarName) {
            $strRet = '';

            if (!$objColumn) {
                $strRet .= <<<TMPL
Severity: Minor
Found in includes/codegen/controls/QControlBase_CodeGenerator.class.php - About 2 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 printResult has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function printResult(PHPUnit_Framework_TestResult $result)
    {
        echo('<h1>QCubed ' . QCUBED_VERSION_NUMBER_ONLY . ' Unit Tests - PHPUnit ' . PHPUnit_Runner_Version::id() . '</h1>');

        foreach ($this->results as $suiteName=>$suite) {
Severity: Minor
Found in assets/php/qcubed_unit_tests.php - About 2 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 __set has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public function __set($strName, $mixValue) {
            switch ($strName) {
                case 'MaxDate':
                case 'Maximum':
                    if (is_string($mixValue)) {
Severity: Major
Found in includes/base_controls/QDatepickerBase.class.php - About 2 hrs to fix

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

            public function __set($strName, $mixValue) {
                switch ($strName) {
                    case "AsButton":
                        try {
                            $this->blnAsButton = QType::Cast($mixValue, QType::Boolean);
    Severity: Major
    Found in includes/base_controls/QHtmlTableColumn.class.php - About 2 hrs to fix

      Method GetItemHtml has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              protected function GetItemHtml($objItem) {
                  $strItemId = $this->strControlId . '_' . $objItem->ItemId;
      
                  $objChildren = $objItem->ChildItemArray;
                  $intChildCount = count($objChildren);
      Severity: Major
      Found in includes/base_controls/QTreeNav.class.php - About 2 hrs to fix

        Method QcubedHandleError has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function QcubedHandleError($__exc_errno, $__exc_errstr, $__exc_errfile, $__exc_errline, $__exc_errcontext) {
                // If a command is called with "@", then we should return
                if (error_reporting() == 0)
                    return true;
        
        
        Severity: Major
        Found in includes/error.inc.php - About 2 hrs to fix

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

                  public function __set($strName, $mixValue) {
                      switch ($strName) {
                          case 'AppendTo':
                              $this->mixAppendTo = $mixValue;
                              $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'appendTo', $mixValue);
          Severity: Major
          Found in includes/base_controls/QSelectableGen.class.php - About 2 hrs to fix

            QHtmlAttributeManagerBase has 25 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class QHtmlAttributeManagerBase extends QBaseClass {
                /** @var  array attributes stored in PHP native format so they can be retrieved. Escaping happens when they are drawn. */
                protected $attributes = array();
                protected $styles = array();
            
            
            Severity: Minor
            Found in includes/base_controls/QHtmlAttributeManagerBase.class.php - About 2 hrs to fix

              QOracleDatabase has 25 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class QOracleDatabase extends QDatabaseBase {
                  const Adapter = 'Oracle Database Adapter';
                  protected $objOracle;
              
                  protected $EscapeIdentifierBegin = '';
              Severity: Minor
              Found in includes/database/QOracleDatabase.class.php - About 2 hrs to fix

                QMySqliDatabase has 25 functions (exceeds 20 allowed). Consider refactoring.
                Open

                    class QMySqliDatabase extends QDatabaseBase {
                        const Adapter = 'MySql Improved Database Adapter for MySQL 4';
                
                        protected $objMySqli;
                
                
                Severity: Minor
                Found in includes/database/QMySqliDatabase.class.php - About 2 hrs to fix

                  Function getAjaxData has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      getAjaxData: function(strForm, strControl, strEvent, mixParameter, strWaitIconControlId) {
                          var $form = $j('#' + strForm),
                              $formElements = $form.find('input,select,textarea'),
                              checkables = [],
                              controls = [],
                  Severity: Major
                  Found in assets/js/qcubed.js - About 2 hrs to fix

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

                            public function __set($strName, $mixValue) {
                                switch ($strName) {
                                    case 'Culture':
                                        try {
                                            $this->strCulture = QType::Cast($mixValue, QType::String);
                    Severity: Major
                    Found in includes/base_controls/QSpinnerGen.class.php - About 2 hrs to fix

                      Method testCasting has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function testCasting() {
                              define('_FAIL_', 'fail');
                              $cases = array( 
                                  //array(value, display, expected result, cast to type),
                                      array("25.0", "25.0", (float)25.0, QType::Float),
                      Severity: Major
                      Found in includes/tests/qcubed-unit/QTypeTest.php - About 2 hrs to fix

                        Method CodeLinks has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                public static function CodeLinks($strCategoryId, $strExampleId, $strSubId, $strCurrentScript) {
                                    $blnIsScript = false;
                        
                                    $strReference = Examples::GetExampleScriptPath($strCategoryId, $strExampleId, $strSubId);
                        
                        
                        Severity: Major
                        Found in assets/php/examples/includes/examples.inc.php - About 2 hrs to fix

                          Method GetForeignKeysForTable has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  public function GetForeignKeysForTable($strTableName) {
                                      $objForeignKeyArray = array();
                                      
                                      // Use Query to pull the FKs
                                      $strQuery = sprintf('
                          Severity: Major
                          Found in includes/database/QSqlServerDatabase.class.php - About 2 hrs to fix

                            Function GetActiveFilterValue has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                            Open

                                    public function GetActiveFilterValue() {
                                        $value = null;
                                        //for manual queries
                                        if (isset($this->FilterByCommand['value']))
                                            $value = $this->FilterByCommand['value'];
                            Severity: Minor
                            Found in includes/base_controls/QDataGridLegacyColumn.class.php - About 2 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