spotweb/spotweb

View on GitHub

Showing 850 of 850 total issues

File jquery.mobile-1.4.5.js has 10421 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
* jQuery Mobile 1.4.5
* Git HEAD hash: 68e55e78b292634d3991c795f06f5e37a512decc <> Date: Fri Oct 31 2014 17:33:30 UTC
* http://jquerymobile.com
*
Severity: Major
Found in js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js - About 1 mo to fix

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

        public function addSpots($spots, $fullSpots = [])
        {
            SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
            foreach ($spots as &$spot) {
                /*
    Severity: Major
    Found in lib/dao/Sqlite/Dao_Sqlite_Spot.php and 1 other location - About 3 days to fix
    lib/dao/Base/Dao_Base_Spot.php on lines 486..546

    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 633.

    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 addSpots($spots, $fullSpots = [])
        {
            SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
            foreach ($spots as &$spot) {
                /*
    Severity: Major
    Found in lib/dao/Base/Dao_Base_Spot.php and 1 other location - About 3 days to fix
    lib/dao/Sqlite/Dao_Sqlite_Spot.php on lines 143..203

    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 633.

    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 compressCategorySelection has a Cognitive Complexity of 157 (exceeds 5 allowed). Consider refactoring.
    Open

        public function compressCategorySelection($categoryList, $strongNotList)
        {
            SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
            $compressedList = '';
    
    
    Severity: Minor
    Found in lib/services/Search/Services_Search_QueryParser.php - About 3 days 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 address has 619 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.address = (function () {
    
            var _trigger = function(name) {
                    var ev = $.extend($.Event(name),
                        (function() {
    Severity: Major
    Found in templates/we1rdo/js/jquery.address.js - About 3 days to fix

      File scripts.js has 1090 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      $.address.init(function() {
          $('.spotlink').address();
      }).externalChange(
              function(event) {
                  basePATH = location.href.replace('#' + $.address.value(), '');
      Severity: Major
      Found in templates/we1rdo/js/scripts.js - About 2 days to fix

        Function process has a Cognitive Complexity of 129 (exceeds 5 allowed). Consider refactoring.
        Open

            public function process($hdrList, $curArtNr, $increment, $timer)
            {
                $this->displayStatus('progress', $curArtNr.' till '.$increment);
        
                $signedCount = 0;
        Severity: Minor
        Found in lib/services/Retriever/Services_Retriever_Spots.php - About 2 days 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 ajaxSubmit has 504 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        $.fn.ajaxSubmit = function(options) {
            /*jshint scripturl:true */
        
            // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
            if (!this.length) {
        Severity: Major
        Found in js/jquery/jquery.form.js - About 2 days to fix

          Function categoriesToJson has a Cognitive Complexity of 110 (exceeds 5 allowed). Consider refactoring.
          Open

              public function categoriesToJson()
              {
                  /*
                   * Don't allow the tree to be cached, it contains the current state of the
                   * tree
          Severity: Minor
          Found in lib/page/SpotPage_catsjson.php - About 2 days 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 SpotPage_newznabapi.php has 887 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          class SpotPage_newznabapi extends SpotPage_Abs
          {
              private $_params;
          Severity: Major
          Found in lib/page/SpotPage_newznabapi.php - About 2 days to fix

            Function createTextQuery has a Cognitive Complexity of 100 (exceeds 5 allowed). Consider refactoring.
            Open

                public function createTextQuery($searchFields, $additionalFields)
                {
                    SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
            
                    /*
            Severity: Minor
            Found in lib/dbeng/dbfts_mysql.php - About 2 days 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 updateSchema has 384 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function updateSchema()
                {
                    // Drop any older (not used anymore) FTS indexes on the spots full table
                    $this->dropIndex('idx_spotsfull_fts_1', 'spotsfull');
                    $this->dropIndex('idx_spotsfull_fts_2', 'spotsfull');
            Severity: Major
            Found in lib/dbstruct/SpotStruct_abs.php - About 1 day to fix

              Function search has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function search($outputtype)
                  {
                      // Check users' permissions
                      $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_perform_search, '');
              
              
              Severity: Minor
              Found in lib/page/SpotPage_newznabapi.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

              SpotTemplateHelper has 98 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class SpotTemplateHelper
              {
                  protected $_settings;
                  protected $_daoFactory;
                  protected $_currentSession;
              Severity: Major
              Found in lib/SpotTemplateHelper.php - About 1 day to fix

                File jquery.form.js has 779 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*!
                 * jQuery Form Plugin
                 * version: 3.15 (09-SEP-2012)
                 * @requires jQuery v1.3.2 or later
                 *
                Severity: Major
                Found in js/jquery/jquery.form.js - About 1 day to fix

                  Function prepareCategorySelection has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function prepareCategorySelection($dynaList)
                      {
                          SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
                  
                          $strongNotList = [];
                  Severity: Minor
                  Found in lib/services/Search/Services_Search_QueryParser.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

                  File SpotTemplateHelper.php has 738 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  // Utility class voor template functies, kan eventueel
                  // door custom templates extended worden
                  use function PHP81_BC\strftime;
                  Severity: Major
                  Found in lib/SpotTemplateHelper.php - About 1 day to fix

                    Function fileUploadIframe has 337 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function fileUploadIframe(a) {
                            var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
                            var useProp = !!$.fn.prop;
                    
                            if ($(':input[name=submit],:input[id=submit]', form).length) {
                    Severity: Major
                    Found in js/jquery/jquery.form.js - About 1 day to fix

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

                              function processImage($tplHelper, $count_newspots, $filterList, $defaultSortField)
                              {
                                  $selfUrl = $tplHelper->makeSelfUrl('path');
                                  foreach ($filterList as $filter) {
                                      $imageFilter = $tplHelper->getPageUrl('index').'&amp;search[tree]='.$filter['tree'];
                      Severity: Major
                      Found in templates/mobile/filters.inc.php and 3 other locations - About 1 day to fix
                      templates/mobile/filters.inc.php on lines 135..168
                      templates/mobile/filters.inc.php on lines 196..229
                      templates/mobile/filters.inc.php on lines 257..290

                      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 4 locations. Consider refactoring.
                      Open

                              function processSounds($tplHelper, $count_newspots, $filterList, $defaultSortField)
                              {
                                  $selfUrl = $tplHelper->makeSelfUrl('path');
                      
                                  foreach ($filterList as $filter) {
                      Severity: Major
                      Found in templates/mobile/filters.inc.php and 3 other locations - About 1 day to fix
                      templates/mobile/filters.inc.php on lines 75..107
                      templates/mobile/filters.inc.php on lines 196..229
                      templates/mobile/filters.inc.php on lines 257..290

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language