qcubed/framework

View on GitHub

Showing 2,378 of 15,774 total issues

Function FetchCellObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function FetchCellObject($item) {
            if ($this->blnNullSafe && $item == null)
                return null;
            foreach ($this->strPropertiesArray as $strProperty) {
                $item = $item->$strProperty;
Severity: Minor
Found in includes/base_controls/QHtmlTableColumn.class.php - About 25 mins 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 GetRowClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        protected function GetRowClass ($objObject, $intRowIndex) {
            if (($intRowIndex % 2) == 1 && $this->strAlternateRowCssClass) {
                return $this->strAlternateRowCssClass;
            } else if ($this->strRowCssClass) {
                return $this->strRowCssClass;
Severity: Minor
Found in includes/base_controls/QHtmlTableBase.class.php - About 25 mins 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 GetColumnIndex has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function GetColumnIndex($strName) {
            $intIndex = -1;
            if ($this->objColumnArray) foreach ($this->objColumnArray as $objColumn) {
                ++$intIndex;
                if ($objColumn->Name == $strName)
Severity: Minor
Found in includes/base_controls/QHtmlTableBase.class.php - About 25 mins 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 Render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function Render() {
            if ($this->blnModified) {
                $strToReturn = '';
                foreach ($this->objControlArray as $objControl) {
                    if ($objControl->Rendered)
Severity: Minor
Found in includes/base_controls/QDropZoneGrouping.class.php - About 25 mins 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 RemoveControl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function RemoveControl($strControlId) {
            if (isset($this->objControlArray[$strControlId])) {
                // Get the Control in Question
                $objControl = $this->objControlArray[$strControlId];

Severity: Minor
Found in includes/base_controls/QFormBase.class.php - About 25 mins 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 GetColumnById has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function GetColumnById($strId) {
            if ($this->objColumnArray) foreach ($this->objColumnArray as $objColumn)
                if ($objColumn->Id === $strId)
                    return $objColumn;
            return null;
Severity: Minor
Found in includes/base_controls/QHtmlTableBase.class.php - About 25 mins 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 GetWebUrl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function GetWebUrl() {
            // First of all, if ClickToView is NOT set, then we obvioulsy will not pass out the URL
            if (!$this->blnClickToView) {
                return null;
            }
Severity: Minor
Found in includes/base_controls/QFileAssetBase.class.php - About 25 mins 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 6 (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/QHtmlTableBase.class.php - About 25 mins 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 GetColumnsByName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function GetColumnsByName($strName) {
            $objColumnArrayToReturn = array();
            if ($this->objColumnArray) foreach ($this->objColumnArray as $objColumn)
                if ($objColumn->Name == $strName)
                    array_push($objColumnArrayToReturn, $objColumn);
Severity: Minor
Found in includes/base_controls/QHtmlTableBase.class.php - About 25 mins 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 EvaluateTemplate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function EvaluateTemplate($strTemplate) {
            global $_ITEM;
            global $_CONTROL;
            global $_FORM;

Severity: Minor
Found in includes/base_controls/QFormBase.class.php - About 25 mins 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 GetColumnByName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function GetColumnByName($strName) {
            if ($this->objColumnArray) foreach ($this->objColumnArray as $objColumn)
                if ($objColumn->Name == $strName)
                    return $objColumn;
            return null;
Severity: Minor
Found in includes/base_controls/QHtmlTableBase.class.php - About 25 mins 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 QCubedShutdown has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function QCubedShutdown() {
        if (defined ('__TIMER_OUT_FILE__')) {
            $strTimerOutput = QTimer::VarDump(false);
            if ($strTimerOutput) {
                file_put_contents(__TIMER_OUT_FILE__, $strTimerOutput . "\n", FILE_APPEND);
Severity: Minor
Found in includes/error.inc.php - About 25 mins 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 ParseNameFromKeyDefinition has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        private function ParseNameFromKeyDefinition($strKeyDefinition) {
            $strKeyDefinition = trim($strKeyDefinition);

            $intPosition = strpos($strKeyDefinition, '(');

Severity: Minor
Found in includes/database/QMySqliDatabase.class.php - About 25 mins 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 GetClient has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        private static function GetClient() {
            if (!class_exists('Predis\Client')) {
                throw new QCallerException('Predis library needs to be installed for Redis Formstate Handler to work');
            }

Severity: Minor
Found in includes/qform_state_handlers/QRedisBackedFormStateHandler.class.php - About 25 mins 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 GetColIndex has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function GetColIndex()
    {
        //cached, to improve performance
        if($this->colIndex == -1)
        {
Severity: Minor
Found in includes/base_controls/QCheckBoxLegacyColumn.class.php - About 25 mins 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 testMod has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function testMod() {
        $objTest = new TypeTest();
        $objTest->TestInt = 11;
        $objTest->Save();
        
Severity: Minor
Found in includes/tests/qcubed-unit/QQFuncTest.php - About 25 mins 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 setButtonActions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        protected function setButtonActions(array $arrButtons = null) {
            // get the QImageBrowser control
            $objImageBrowser = $this->ParentControl;
            while ( !($objImageBrowser instanceof QImageBrowserBase) ) {
                $objImageBrowser = $objImageBrowser->ParentControl;
Severity: Minor
Found in includes/base_controls/QImageBrowser.class.php - About 25 mins 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 Connect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function Connect() {
            // Lookup Adapter-Specific Connection Properties
            $strServer = $this->Server;
            $strName = $this->Database;
            $strUsername = $this->Username;
Severity: Minor
Found in includes/database/QMySqlDatabase.class.php - About 25 mins 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 CalculateGraphPrefixArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        protected function CalculateGraphPrefixArray($objForeignKeyArray) {
            // Analyze Column Names to determine GraphPrefixArray
            if ((strpos(strtolower($objForeignKeyArray[0]->ColumnNameArray[0]), 'parent') !== false) ||
                (strpos(strtolower($objForeignKeyArray[1]->ColumnNameArray[0]), 'child') !== false)) {
                $strGraphPrefixArray[0] = '';
Severity: Minor
Found in includes/codegen/QCodeGenBase.class.php - About 25 mins 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 Connect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function Connect() {
            // Lookup Adapter-Specific Connection Properties
            $strServer = $this->Server;
            $strName = $this->Database;
            $strUsername = $this->Username;
Severity: Minor
Found in includes/database/QSqlServer2005Database.class.php - About 25 mins 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