qcubed/framework

View on GitHub

Showing 2,378 of 15,774 total issues

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

        public function __set($strName, $mixValue) {
            switch ($strName) {
                // APPEARANCE
                case "TextAlign":
                    try {
Severity: Minor
Found in includes/base_controls/QRadioButtonList.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

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

<?php
    /**
     * An abstract utility class to handle string manipulation.  All methods
     * are statically available.
     */
Severity: Minor
Found in includes/framework/QString.class.php - About 3 hrs to fix

    Method SetFieldType has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            protected function SetFieldType($intMySqlFieldType) {
    
                if (version_compare(PHP_VERSION, '5.6.15') >= 0) {
                    if (defined("MYSQLI_TYPE_JSON") && $intMySqlFieldType == MYSQLI_TYPE_JSON) {
                        $this->strType = QDatabaseFieldType::Json;
    Severity: Major
    Found in includes/database/QMySqliDatabase.class.php - About 3 hrs to fix

      Method testCss has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function testCss() {        
              $objCaseArray = array( 
                  array(
                      "Value" => "0", "Expected" => "0;", "Msg" => "String zero renders with no 'px'"
                  ),
      Severity: Major
      Found in includes/tests/qcubed-unit/QControlBaseTest.php - About 3 hrs to fix

        Function Sizzle has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function Sizzle( selector, context, results, seed ) {
            var match, elem, m, nodeType,
                // QSA vars
                i, groups, old, nid, newContext, newSelector;
        
        
        Severity: Major
        Found in assets/js/jquery/jquery.js - About 3 hrs to fix

          Function Datepicker has 76 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function Datepicker() {
              this._curInst = null; // The current instance in use
              this._keyEvent = false; // If the last event was a key event
              this._disabledInputs = []; // List of date picker inputs that have been disabled
              this._datepickerShowing = false; // True if the popup picker is showing , false if not
          Severity: Major
          Found in assets/js/jquery/jquery-ui.custom.js - About 3 hrs to fix

            Function _refresh has 76 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _refresh: function() {
                    var maxHeight,
                        options = this.options,
                        heightStyle = options.heightStyle,
                        parent = this.element.parent();
            Severity: Major
            Found in assets/js/jquery/jquery-ui.custom.js - About 3 hrs to fix

              Method GetAttributes has 76 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public function GetAttributes() {
                          $strToReturn = "";
                          $strStyle = "";            
              
                          if (!$this->blnWrap)
              Severity: Major
              Found in includes/base_controls/QDataGridLegacyColumn.class.php - About 3 hrs to fix

                Function _mouseDrag has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _mouseDrag: function(event) {
                        var i, item, itemElement, intersection,
                            o = this.options,
                            scrolled = false;
                
                
                Severity: Major
                Found in assets/js/jquery/jquery-ui.custom.js - About 3 hrs to fix

                  Function _mouseStart has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _mouseStart: function(event, overrideHandle, noActivation) {
                  
                          var i, body,
                              o = this.options;
                  
                  
                  Severity: Major
                  Found in assets/js/jquery/jquery-ui.custom.js - About 3 hrs to fix

                    Method SetupSoapMethods has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            protected function SetupSoapMethods(ReflectionClass $objReflection) {
                                $objReflectionMethods = $objReflection->getMethods();
                                if ($objReflectionMethods) foreach ($objReflectionMethods as $objReflectionMethod) {
                                    if ($objReflectionMethod->isPublic() && !$objReflectionMethod->isAbstract() &&
                                        !$objReflectionMethod->isStatic() &&  !$objReflectionMethod->isConstructor() &&
                    Severity: Major
                    Found in includes/framework/QSoapService.class.php - About 3 hrs to fix

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

                              public function __set($strName, $mixValue) {
                                  switch ($strName) {
                                      case '_ClickedButton': // Internal only. Do not use. Used by JS above to keep track of clicked button.
                                          try {
                                              $this->strClickedButtonId = QType::Cast($mixValue, QType::String);
                      Severity: Major
                      Found in includes/base_controls/QDialogBase.class.php - About 3 hrs to fix

                        Function buildFragment has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            buildFragment: function( elems, context, scripts, selection ) {
                                var j, elem, contains,
                                    tmp, tag, tbody, wrap,
                                    l = elems.length,
                        
                        
                        Severity: Major
                        Found in assets/js/jquery/jquery.js - About 2 hrs to fix

                          Function resize has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              resize: function( event ) {
                                  var woset, hoset, isParent, isOffsetRelative,
                                      that = $( this ).resizable( "instance" ),
                                      o = that.options,
                                      co = that.containerOffset,
                          Severity: Major
                          Found in assets/js/jquery/jquery-ui.custom.js - About 2 hrs to fix

                            Function _mouseDrag has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                _mouseDrag: function(event) {
                            
                                    this.dragged = true;
                            
                                    if (this.options.disabled) {
                            Severity: Major
                            Found in assets/js/jquery/jquery-ui.custom.js - About 2 hrs to fix

                              Method testFormatLength has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function testFormatLength() {
                                      $objCaseArray = array( 
                                          array(
                                              "Value" => "0", "Expected" => "0", "Msg" => "String zero renders with no 'px'"
                                          ),
                              Severity: Major
                              Found in includes/tests/qcubed-unit/QCssTest.php - About 2 hrs to fix

                                File jq_control.php has 290 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                <?php
                                //include_once('simple_html_dom.php');
                                require('qcubed.inc.php');
                                require(__INCLUDES__ . '/codegen/QCodeGen.class.php');
                                
                                
                                Severity: Minor
                                Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 2 hrs to fix

                                  Function widget has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  $.widget = function( name, base, prototype ) {
                                      var fullName, existingConstructor, constructor, basePrototype,
                                          // proxiedPrototype allows the provided prototype to remain unmodified
                                          // so that it can be used as a mixin for multiple widgets (#8876)
                                          proxiedPrototype = {},
                                  Severity: Major
                                  Found in assets/js/jquery/jquery-ui.custom.js - About 2 hrs to fix

                                    Function add has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        add: function( elem, types, handler, data, selector ) {
                                            var tmp, events, t, handleObjIn,
                                                special, eventHandle, handleObj,
                                                handlers, type, namespaces, origType,
                                                elemData = jQuery._data( elem );
                                    Severity: Major
                                    Found in assets/js/jquery/jquery.js - About 2 hrs to fix

                                      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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language