spotweb/spotweb

View on GitHub

Showing 668 of 850 total issues

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

    protected function calculateFilePath($cacheId, $cacheType, $metadata)
    {
        $filePath = $this->_cachePath.DIRECTORY_SEPARATOR;

        switch ($cacheType) {
Severity: Minor
Found in lib/dao/Base/Dao_Base_Cache.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

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

    public function update()
    {
        /*
         * Make sure some versionnumbers are always in the db, so
         * comparisons always work
Severity: Major
Found in lib/services/Upgrade/Services_Upgrade_Settings.php - About 3 hrs to fix

    SpotStruct_mysql has 26 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SpotStruct_mysql extends SpotStruct_abs
    {
        /*
         * Optimize / analyze (database specific) a number of hightraffic
         * tables.
    Severity: Minor
    Found in lib/dbstruct/SpotStruct_mysql.php - About 3 hrs to fix

      SpotStruct_sqlite has 26 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class SpotStruct_sqlite extends SpotStruct_abs
      {
          /*
           * Optimize / analyze (database specific) a number of hightraffic
           * tables.
      Severity: Minor
      Found in lib/dbstruct/SpotStruct_sqlite.php - About 3 hrs to fix

        SpotStruct_pgsql has 26 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class SpotStruct_pgsql extends SpotStruct_abs
        {
            /*
             * Optimize / analyze (database specific) a number of hightraffic
             * tables.
        Severity: Minor
        Found in lib/dbstruct/SpotStruct_pgsql.php - About 3 hrs to fix

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

              public function filtersToXml($filterList)
              {
                  $svcSearchQP = new Services_Search_QueryParser($this->_daoFactory->getConnection());
          
                  // create the XML document
          Severity: Major
          Found in lib/services/User/Services_User_Filters.php - About 3 hrs to fix

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

            <?php
            
            class Services_Format_Parsing
            {
                private $_spotSigning = null;
            Severity: Minor
            Found in lib/services/Format/Services_Format_Parsing.php - About 2 hrs to fix

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

                  public function updateSecurityGroups($forceReset)
                  {
                      // DB connectie
                      $dbCon = $this->_dbCon;
              
              
              Severity: Major
              Found in lib/services/Upgrade/Services_Upgrade_Users.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 js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js - About 2 hrs to fix

                  Function render has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function render()
                      {
                          $result = new Dto_FormResult('notsubmitted');
                  
                          // Make sure the user has the appropriate rights
                  Severity: Minor
                  Found in lib/page/SpotPage_editfilter.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

                  Function getSpotComments has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getSpotComments($msgId, $prevMsgids, $userId, $start, $length, $language)
                      {
                          // Check users' permissions
                          $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_view_comments, '');
                  
                  
                  Severity: Minor
                  Found in lib/services/Actions/Services_Actions_GetComments.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

                  Function oldCalculateFilePath has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function oldCalculateFilePath($cacheId, $cacheType, $metadata)
                      {
                          /*
                           * Get the cache id
                           */
                  Severity: Minor
                  Found in lib/dao/Base/Dao_Base_Cache.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

                  Function openDialog has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function openDialog(divid, title, url, buttonClick, successAction, closeCb, openCb) {
                      var $dialdiv = $("#" + divid);
                      /* submit button handler */
                      if (!buttonClick) {
                          var buttonClick = function() {
                  Severity: Major
                  Found in templates/mobile/includes/js/spotdialogs.js - About 2 hrs to fix

                    Function _applyOptions has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _applyOptions: function( options ) {
                            var isCollapsed, newTheme, oldTheme, hasCorners, hasIcon,
                                elem = this.element,
                                currentOpts = this._renderedOptions,
                                ui = this._ui,
                    Severity: Major
                    Found in js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js - About 2 hrs to fix

                      Dao_Base_User has 25 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Dao_Base_User implements Dao_User
                      {
                          protected $_conn;
                      
                          /*
                      Severity: Minor
                      Found in lib/dao/Base/Dao_Base_User.php - About 2 hrs to fix

                        Method compressCategorySelection has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function compressCategorySelection($categoryList, $strongNotList)
                            {
                                SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
                                $compressedList = '';
                        
                        
                        Severity: Major
                        Found in lib/services/Search/Services_Search_QueryParser.php - About 2 hrs to fix

                          Method getSpots has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function getSpots($ourUserId, $pageNr, $limit, $parsedSearch)
                              {
                                  SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
                                  $offset = (int) $pageNr * (int) $limit;
                          
                          
                          Severity: Major
                          Found in lib/dao/Base/Dao_Base_Spot.php - About 2 hrs to fix

                            Function load has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    load: function( url, options ) {
                                        // This function uses deferred notifications to let callers
                                        // know when the content is done loading, or if an error has occurred.
                                        var deferred = ( options && options.deferred ) || $.Deferred(),
                            
                            
                            Severity: Major
                            Found in js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js - About 2 hrs to fix

                              Function spotEditLoadCategoryIntoSelectbox has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function spotEditLoadCategoryIntoSelectbox(selectId, titleElm, data, async, doClear, subcategory) {
                                  if (typeof subcategory == "undefined") { subcategory = new Array(); }
                              
                                  var $selectbox = $("#" + selectId);
                                  if (titleElm) {
                              Severity: Minor
                              Found in templates/we1rdo/js/scripts.js - 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

                              Function cookie has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                              Open

                              jQuery.cookie = function (key, value, options) {
                              
                                  // key and value given, set cookie...
                                  if (arguments.length > 1 && (value === null || typeof value !== "object")) {
                                      options = jQuery.extend({}, options);
                              Severity: Minor
                              Found in js/jquery/jquery.cookie.js - 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