qcubed/framework

View on GitHub

Showing 2,378 of 15,774 total issues

Function Validate has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

        public function Validate() {
            if (parent::Validate()) {
                if ($this->strText != "") {
                    $dttTest = QDateTimeTextBox::ParseForDateTimeValue($this->strText);

Severity: Minor
Found in includes/base_controls/QDateTimeTextBox.class.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 31 (exceeds 5 allowed). Consider refactoring.
Open

        public function __construct($mixFieldData, $objDb = null) {
                $this->strName = $mixFieldData->GetColumn('column_name');
                $this->strOriginalName = $this->strName;
                $this->strTable = $mixFieldData->GetColumn('table_name');
                $this->strOriginalTable = $this->strTable;
Severity: Minor
Found in includes/database/QPostgreSqlPdoDatabase.class.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 AnalyzeAssociationTable has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

        protected function AnalyzeAssociationTable($strTableName) {
            $objFieldArray = $this->objDb->GetFieldsForTable($strTableName);

            // Association tables must have 2 fields
            if (count($objFieldArray) != 2) {
Severity: Minor
Found in includes/codegen/QDatabaseCodeGen.class.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

Method RenderEnd has 114 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public function RenderEnd($blnDisplayOutput = true) {
            // Ensure that RenderEnd() has not yet been called
            switch ($this->intFormStatus) {
                case QFormBase::FormStatusUnrendered:
                    throw new QCallerException('$this->RenderBegin() was never called');
Severity: Major
Found in includes/base_controls/QFormBase.class.php - About 4 hrs to fix

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

            public function __set($strName, $mixValue) {
                switch ($strName) {
                    // APPEARANCE
                    case "TextAlign":
                        try {
    Severity: Major
    Found in includes/base_controls/QCheckBoxList.class.php - About 4 hrs to fix

      Function Validate has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

              public function Validate() {
                  if (parent::Validate()) {
                      if ($this->strText != "") {
                          try {
                              $this->strText = QType::Cast($this->strText, $this->strDataType);
      Severity: Minor
      Found in includes/base_controls/QNumericTextBox.class.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

      Method ConnectorCreate has 109 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public function ConnectorCreate(QCodeGenBase $objCodeGen, QSqlTable $objTable, $objColumn) {
                  $strObjectName = $objCodeGen->ModelVariableName($objTable->Name);
                  $strControlVarName = $objCodeGen->ModelConnectorVariableName($objColumn);
                  $strLabelName = addslashes(QCodeGen::ModelConnectorControlName($objColumn));
                  $strPropName = QCodeGen::ModelConnectorPropertyName($objColumn);
      Severity: Major
      Found in includes/codegen/controls/QListControlBase_CodeGenerator.class.php - About 4 hrs to fix

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

        <?php
            /**
             * An abstract utility class to handle Html tag rendering, as well as utilities to render
             * pieces of HTML and CSS code.  All methods are static.
             */
        Severity: Minor
        Found in includes/framework/QHtml.class.php - About 4 hrs to fix

          Function __set has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

                  public function __set($strName, $mixValue) {
                      switch ($strName) {
                          case 'MaxDate':
                          case 'Maximum':
                              try{
          Severity: Minor
          Found in includes/base_controls/QDatepickerBoxBase.class.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 GetFilterRowHtml has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

                  protected function GetFilterRowHtml() {
                      $objFilterStyle = $this->objRowStyle->ApplyOverride($this->objFilterRowStyle);
                      $strToReturn = sprintf('  <tr %s>'."\r\n", $objFilterStyle->GetAttributes());
                      if($this->objColumnArray !== null)
                      {
          Severity: Minor
          Found in includes/base_controls/QDataGridLegacyBase.class.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 SetCssBoxValue has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

              public function SetCssBoxValue($strPrefix, $mixValue) {
                  if (is_string($mixValue)) {
                      // shortcut
                      $this->SetCssStyle($strPrefix, $mixValue);
                  } elseif (is_array($mixValue)) {
          Severity: Minor
          Found in includes/base_controls/QHtmlAttributeManagerBase.class.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 Validate has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

                  public function Validate() {
                      if ($this->blnRequired) {
                          $blnIsNull = false;
                          
                          if (!$this->dttDateTime)
          Severity: Minor
          Found in includes/base_controls/QDateTimePicker.class.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 SetupTabs has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function SetupTabs() {
                  $strClassNames = $this->CreateClassNameArray();
                  $this->tabs->RemoveChildControls(true);
                  $this->categories = array();
          
          
          Severity: Minor
          Found in includes/codegen/QModelConnectorEditDlg.class.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 CodeLinks has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

                  public static function CodeLinks($strCategoryId, $strExampleId, $strSubId, $strCurrentScript) {
                      $blnIsScript = false;
          
                      $strReference = Examples::GetExampleScriptPath($strCategoryId, $strExampleId, $strSubId);
          
          
          Severity: Minor
          Found in assets/php/examples/includes/examples.inc.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

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

                  public function __set($strName, $mixValue) {
                      $this->blnModified = true;
          
                      switch ($strName) {
                          // MISC
          Severity: Major
          Found in includes/base_controls/QDateTimePicker.class.php - About 4 hrs to fix

            Function defaultPrefilter has 105 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function defaultPrefilter( elem, props, opts ) {
                /* jshint validthis: true */
                var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
                    anim = this,
                    orig = {},
            Severity: Major
            Found in assets/js/jquery/jquery.js - About 4 hrs to fix

              Method ParsePostData has 105 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public function ParsePostData() {
              
                          $blnIsDateTimeSet = false;
                          if ($this->dttDateTime == null) {
                              $dttNewDateTime = QDateTime::Now();
              Severity: Major
              Found in includes/base_controls/QDateTimePicker.class.php - About 4 hrs to fix

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

                        public final static function LongestCommonSubsequence($str1, $str2) {
                            if (defined('__QAPPLICATION_ENCODING_TYPE__')) {
                                $str1Len = mb_strlen($str1, __QAPPLICATION_ENCODING_TYPE__);
                                $str2Len = mb_strlen($str2, __QAPPLICATION_ENCODING_TYPE__);
                            } else {
                Severity: Minor
                Found in includes/framework/QString.class.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 __set has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                Open

                        public function __set($strName, $mixValue) {
                            switch ($strName) {
                                // APPEARANCE
                                case "Text":
                                    try {
                Severity: Minor
                Found in includes/base_controls/QBlockControl.class.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 MakeJqOptions has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                Open

                        protected function MakeJqOptions() {
                            $jqOptions = null;
                            if (!is_null($val = $this->AddClasses)) {$jqOptions['addClasses'] = $val;}
                            if (!is_null($val = $this->AppendTo)) {$jqOptions['appendTo'] = $val;}
                            if (!is_null($val = $this->Axis)) {$jqOptions['axis'] = $val;}
                Severity: Minor
                Found in includes/base_controls/QDraggableGen.class.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