qcubed/framework

View on GitHub

Showing 2,378 of 15,774 total issues

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

        public function __set($strName, $mixValue) {
            switch ($strName) {
                case "RowCssClass":
                    try {
                        $this->strRowCssClass = QType::Cast($mixValue, QType::String);
Severity: Major
Found in includes/base_controls/QHtmlTableBase.class.php - About 3 hrs to fix

    Function CastValueTo has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

            private static function CastValueTo($mixItem, $strNewType) {
                $strOriginalType = gettype($mixItem);
    
                switch (QType::TypeFromDoc($strNewType)) {
                    case QType::Boolean:
    Severity: Minor
    Found in includes/framework/QType.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 toJsObject has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

            public static function toJsObject($objValue) {
                $strRet = '';
    
                switch (gettype($objValue)) {
                    case 'double':
    Severity: Minor
    Found in includes/framework/JavaScriptHelper.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 Autoload has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

            public static function Autoload($strClassName) {
                if (isset(QApplication::$ClassFile[strtolower($strClassName)])) {
                    require_once (QApplication::$ClassFile[strtolower($strClassName)]);
                    return true;
                } else if (file_exists($strFilePath = sprintf('%s/%s.class.php', __INCLUDES__, $strClassName))) {
    Severity: Minor
    Found in includes/framework/QApplicationBase.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 MakeJqOptions has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

            protected function MakeJqOptions() {
                $jqOptions = null;
                if (!is_null($val = $this->AppendTo)) {$jqOptions['appendTo'] = $val;}
                if (!is_null($val = $this->Axis)) {$jqOptions['axis'] = $val;}
                if (!is_null($val = $this->Cancel)) {$jqOptions['cancel'] = $val;}
    Severity: Minor
    Found in includes/base_controls/QSortableGen.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 25 (exceeds 5 allowed). Consider refactoring.
    Open

            public function __set($strName, $mixValue) {
                switch ($strName) {
                    case "AsButton":
                        try {
                            $this->blnAsButton = QType::Cast($mixValue, QType::Boolean);
    Severity: Minor
    Found in includes/base_controls/QHtmlTableColumn.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 FlowThrough has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

            protected function FlowThrough($strPath) {
                // No Image Type changing
                if ((!$this->strImageType) || ($this->strImageType == $this->strSourceImageType)) {
                    if ($strPath)
                        copy($this->strImagePath, $strPath);
    Severity: Minor
    Found in includes/base_controls/QImageControlBase.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 Validate has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

            public function Validate() {
                // Copy text
                $strText = $this->strText;
                // Check for Required
                if ($this->blnRequired) {
    Severity: Minor
    Found in includes/base_controls/QTextBoxBase.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 25 (exceeds 5 allowed). Consider refactoring.
    Open

            public function __set($strName, $mixValue) {
                $this->blnModified = true;
                switch ($strName) {
                    case "MinDate" :
                        try {
    Severity: Minor
    Found in includes/base_controls/QCalendar.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 GenerateAll has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

            public function GenerateAll() {
                $strReport = '';
    
                // Iterate through all the tables, generating one class at a time
                if ($this->objTableArray) foreach ($this->objTableArray as $objTable) {
    Severity: Minor
    Found in includes/codegen/QDatabaseCodeGen.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 trigger has 89 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        trigger: function( event, data, elem, onlyHandlers ) {
            var handle, ontype, cur,
                bubbleType, special, tmp, i,
                eventPath = [ elem || document ],
                type = hasOwn.call( event, "type" ) ? event.type : event,
    Severity: Major
    Found in assets/js/jquery/jquery.js - About 3 hrs to fix

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

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

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

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

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

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

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

                    public function ConnectorCreate(QCodeGenBase $objCodeGen, QSqlTable $objTable, $objColumn) {
                        if ($objColumn instanceof QManyToManyReference) {
                            throw new Exception ("Autocomplete does not support many-to-many references.");
                        }
            
            
            Severity: Major
            Found in includes/codegen/controls/QAutocompleteBase_CodeGenerator.class.php - About 3 hrs to fix

              Method SetupTabs has 87 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function SetupTabs() {
                      $strClassNames = $this->CreateClassNameArray();
                      $this->tabs->RemoveChildControls(true);
                      $this->categories = array();
              
              
              Severity: Major
              Found in includes/codegen/QModelConnectorEditDlg.class.php - About 3 hrs to fix

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

                        public function Validate() {
                            if (!parent::Validate()) {
                                return false;
                            }
                
                
                Severity: Minor
                Found in includes/base_controls/QDatepickerBoxBase.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 MakeUrl has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                Open

                        public static function MakeUrl ($strLocation, $queryParams = null, $strAnchor = null, $strScheme = null, $strHost = null, $strUser = null, $strPassword = null, $intPort = null) {
                            // Decompose
                            if ($strLocation) {
                                $params = parse_url($strLocation);
                            }
                Severity: Minor
                Found in includes/framework/QHtml.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 InitializeDatabaseConnections has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                Open

                        public static function InitializeDatabaseConnections() {
                            // for backward compatibility, don't use MAX_DB_CONNECTION_INDEX directly,
                            // but check if MAX_DB_CONNECTION_INDEX is defined
                            $intMaxIndex = defined('MAX_DB_CONNECTION_INDEX') ? constant('MAX_DB_CONNECTION_INDEX') : 9;
                
                
                Severity: Minor
                Found in includes/framework/QApplicationBase.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 QueryCount has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function QueryCount(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
                        // Get the Query Statement
                        try {
                            $strQuery = static::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, true);
                        } catch (QCallerException $objExc) {
                Severity: Minor
                Found in includes/framework/QModelTrait.trait.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