qcubed/framework

View on GitHub

Showing 15,774 of 15,774 total issues

Function AnalyzeDatabase has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
Open

        protected function AnalyzeDatabase() {
            if (!QApplication::$Database) {
                $this->strErrors = 'FATAL ERROR: No databases are listed in the configuration file.';
                return;
            }
Severity: Minor
Found in includes/codegen/QDatabaseCodeGen.class.php - About 1 day 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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        public function SqlVariable($mixData, $blnIncludeEquality = false, $blnReverseEquality = false) {
                // Are we SqlVariabling a BOOLEAN value?
                if (is_bool($mixData)) {
                        // Yes
                        if ($blnIncludeEquality) {
Severity: Major
Found in includes/database/QInformixPdoDatabase.class.php and 1 other location - About 1 day to fix
includes/database/QSqLite3PdoDatabase.class.php on lines 49..120

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 384.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        public function SqlVariable($mixData, $blnIncludeEquality = false, $blnReverseEquality = false) {
                // Are we SqlVariabling a BOOLEAN value?
                if (is_bool($mixData)) {
                        // Yes
                        if ($blnIncludeEquality) {
Severity: Major
Found in includes/database/QSqLite3PdoDatabase.class.php and 1 other location - About 1 day to fix
includes/database/QInformixPdoDatabase.class.php on lines 114..185

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 384.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

QControlBase has 96 functions (exceeds 20 allowed). Consider refactoring.
Open

    abstract class QControlBase extends QHtmlAttributeManager {

        /*
         * Constannts
         */
Severity: Major
Found in includes/base_controls/QControlBase.class.php - About 1 day to fix

    Function RenderImage has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
    Open

            public function RenderImage($strPath = null) {
                if (!$this->strImagePath)
                    throw new QCallerException('No Image Path was set');
    
                // Flow Through if No Size Information
    Severity: Minor
    Found in includes/base_controls/QImageControlBase.class.php - About 1 day 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 Initialize has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
    Open

            public static function Initialize() {
                self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
    
                // Are we running as CLI?
                if (PHP_SAPI == 'cli')
    Severity: Minor
    Found in includes/framework/QApplicationBase.class.php - About 1 day 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 GetControlHtml has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
    Open

            protected function GetControlHtml() {
                // Ignore Class
                $strCssClass = $this->strCssClass;
                $this->strCssClass = '';
                $strAttributes = $this->GetAttributes();
    Severity: Minor
    Found in includes/base_controls/QDateTimePicker.class.php - About 1 day 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 86 (exceeds 5 allowed). Consider refactoring.
    Open

            public function __set($strName, $mixValue) {
                switch ($strName) {
                    // Shunt position settings to the wrapper. Actual drawing will get resolved at draw time.
                    case "Position":
                    case "Top":
    Severity: Minor
    Found in includes/base_controls/QControlBase.class.php - About 1 day 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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        public function testMultiLeafExpansion() {
            $objMilestone = Milestone::QuerySingle(
                QQ::Equal (QQN::Milestone()->Id, 1),
                QQ::Clause(
                    QQ::ExpandAsArray(QQN::Milestone()->Project->ManagerPerson->ProjectAsTeamMember),
    Severity: Major
    Found in includes/tests/qcubed-unit/ExpandAsArrayTest.php and 1 other location - About 1 day to fix
    includes/tests/qcubed-unit/CacheTest.php on lines 282..319

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 362.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        public function testMultiLeafExpansion() {
            $objMilestone = Milestone::QuerySingle(
                QQ::Equal (QQN::Milestone()->Id, 1),
                QQ::Clause(
                    QQ::ExpandAsArray(QQN::Milestone()->Project->ManagerPerson->ProjectAsTeamMember),
    Severity: Major
    Found in includes/tests/qcubed-unit/CacheTest.php and 1 other location - About 1 day to fix
    includes/tests/qcubed-unit/ExpandAsArrayTest.php on lines 257..294

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 362.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        public function __set($strName, $mixValue) {
            switch ($strName) {
                // Styles
                case "BackColor":
                    try {
    Severity: Minor
    Found in includes/base_controls/QHtmlAttributeManagerBase.class.php - About 1 day 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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            public static function GetModelConnectorParams() {
                return array_merge(parent::GetModelConnectorParams(), array(
                    new QModelConnectorParam (get_called_class(), 'AutoOpen', 'If set to true, the dialog will automatically open uponinitialization. If false, the dialog will stay hidden until the open()method is called.', QType::Boolean),
                    new QModelConnectorParam (get_called_class(), 'CloseOnEscape', 'Specifies whether the dialog should close when it has focus and theuser presses the escape (ESC) key.', QType::Boolean),
                    new QModelConnectorParam (get_called_class(), 'CloseText', 'Specifies the text for the close button. Note that the close text isvisibly hidden when using a standard theme.', QType::String),
    Severity: Major
    Found in includes/base_controls/QDialogGen.class.php and 1 other location - About 1 day to fix
    includes/base_controls/QResizableGen.class.php on lines 628..644

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 360.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            public static function GetModelConnectorParams() {
                return array_merge(parent::GetModelConnectorParams(), array(
                    new QModelConnectorParam (get_called_class(), 'Animate', 'Animates to the final size after resizing.', QType::Boolean),
                    new QModelConnectorParam (get_called_class(), 'AnimateEasing', 'Which easing to apply when using the animate option.', QType::String),
                    new QModelConnectorParam (get_called_class(), 'AutoHide', 'Whether the handles should hide when the user is not hovering over theelement.', QType::Boolean),
    Severity: Major
    Found in includes/base_controls/QResizableGen.class.php and 1 other location - About 1 day to fix
    includes/base_controls/QDialogGen.class.php on lines 729..745

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 360.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    <?php
        /**
         * This abstract class should never be instantiated.  It contains static methods,
         * variables and constants to be used throughout the application.
         *
    Severity: Major
    Found in includes/framework/QApplicationBase.class.php - About 1 day to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              public function InsertOrUpdate($strTable, $mixColumnsAndValuesArray, $strPKNames = null) {
                  $strEscapedArray = $this->EscapeIdentifiersAndValues($mixColumnsAndValuesArray);
                  $strColumns = array_keys($strEscapedArray);
                  $strUpdateStatement = '';
                  foreach ($strEscapedArray as $strColumn => $strValue) {
      Severity: Major
      Found in includes/database/QPostgreSqlDatabase.class.php and 1 other location - About 1 day to fix
      includes/database/QPostgreSqlPdoDatabase.class.php on lines 13..50

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 356.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          public function InsertOrUpdate($strTable, $mixColumnsAndValuesArray, $strPKNames = null) {
                  $strEscapedArray = $this->EscapeIdentifiersAndValues($mixColumnsAndValuesArray);
                  $strColumns = array_keys($strEscapedArray);
                  $strUpdateStatement = '';
                  foreach ($strEscapedArray as $strColumn => $strValue) {
      Severity: Major
      Found in includes/database/QPostgreSqlPdoDatabase.class.php and 1 other location - About 1 day to fix
      includes/database/QPostgreSqlDatabase.class.php on lines 165..202

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 356.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      <?php    
      
          /* Custom "property" event classes for this control */
          /**
           * Type:Function( Element input, Object inst )Default:nullA function that
      Severity: Major
      Found in includes/base_controls/QDatepickerGen.class.php - About 1 day to fix

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

        <?php    
        
            /* Custom "property" event classes for this control */
            /**
             * Type:Function( Element input, Object inst )Default:nullA function that
        Severity: Major
        Found in includes/base_controls/QDatepickerBoxGen.class.php - About 1 day to fix

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

              _adjustOffsetFromHelper: function(obj) {
                  if (typeof obj === "string") {
                      obj = obj.split(" ");
                  }
                  if ($.isArray(obj)) {
          Severity: Major
          Found in assets/js/jquery/jquery-ui.custom.js and 1 other location - About 1 day to fix
          assets/js/jquery/jquery-ui.custom.js on lines 1860..1879

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 296.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

              _adjustOffsetFromHelper: function(obj) {
                  if (typeof obj === "string") {
                      obj = obj.split(" ");
                  }
                  if ($.isArray(obj)) {
          Severity: Major
          Found in assets/js/jquery/jquery-ui.custom.js and 1 other location - About 1 day to fix
          assets/js/jquery/jquery-ui.custom.js on lines 5312..5331

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 296.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Severity
          Category
          Status
          Source
          Language