spotweb/spotweb

View on GitHub

Showing 850 of 850 total issues

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

        function processGames($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 135..168
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 processApps($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 135..168
templates/mobile/filters.inc.php on lines 196..229

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 jquery.address.js has 656 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * jQuery Address Plugin v1.5
 * http://www.asual.com/jquery/address/
 *
 * Copyright (c) 2009-2010 Rostislav Hristov
Severity: Major
Found in templates/we1rdo/js/jquery.address.js - About 1 day to fix

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

    <?php
    
     class Dao_Sqlite_Factory extends Dao_Factory
     {
         private $_conn;
    Severity: Major
    Found in lib/dao/Sqlite/Dao_Sqlite_Factory.php and 2 other locations - About 1 day to fix
    lib/dao/Mysql/Dao_Mysql_Factory.php on lines 1..153
    lib/dao/Postgresql/Dao_Postgresql_Factory.php on lines 1..153

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

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

    <?php
    
     class Dao_Postgresql_Factory extends Dao_Factory
     {
         private $_conn;
    Severity: Major
    Found in lib/dao/Postgresql/Dao_Postgresql_Factory.php and 2 other locations - About 1 day to fix
    lib/dao/Mysql/Dao_Mysql_Factory.php on lines 1..153
    lib/dao/Sqlite/Dao_Sqlite_Factory.php on lines 1..153

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

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

    <?php
    
     class Dao_Mysql_Factory extends Dao_Factory
     {
         private $_conn;
    Severity: Major
    Found in lib/dao/Mysql/Dao_Mysql_Factory.php and 2 other locations - About 1 day to fix
    lib/dao/Postgresql/Dao_Postgresql_Factory.php on lines 1..153
    lib/dao/Sqlite/Dao_Sqlite_Factory.php on lines 1..153

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

    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 displayStatus($cat, $txt)
        {
            switch ($cat) {
                case 'start': echo 'Retrieving new reports from server '.$txt.'...'.PHP_EOL;
                    break;
    Severity: Major
    Found in lib/services/Retriever/Services_Retriever_Reports.php and 1 other location - About 1 day to fix
    lib/services/Retriever/Services_Retriever_Comments.php on lines 30..66

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

    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 displayStatus($cat, $txt)
        {
            switch ($cat) {
                case 'start': echo 'Retrieving new comments from server '.$txt.'...'.PHP_EOL;
                    break;
    Severity: Major
    Found in lib/services/Retriever/Services_Retriever_Comments.php and 1 other location - About 1 day to fix
    lib/services/Retriever/Services_Retriever_Reports.php on lines 25..61

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

    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 Dao_Base_Spot.php has 614 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    class Dao_Base_Spot implements Dao_Spot
    {
        protected $_conn;
    Severity: Major
    Found in lib/dao/Base/Dao_Base_Spot.php - About 1 day to fix

      Method process has 252 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function process($hdrList, $curArtNr, $increment, $timer)
          {
              $this->displayStatus('progress', $curArtNr.' till '.$increment);
      
              $signedCount = 0;
      Severity: Major
      Found in lib/services/Retriever/Services_Retriever_Spots.php - About 1 day to fix

        Function parseHeader has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
        Open

            public function parseHeader($subj, $from, $date, $messageid, $rsaKeys)
            {
                // Initialize an empty array, we create a basic template in a few
                $spot = [];
        
        
        Severity: Minor
        Found in lib/services/Format/Services_Format_Parsing.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

            _setOptions: function( options ) {
                var closeButtonLocation, closeButtonText,
                    currentOpts = this.options;
        
                if ( options.corners !== undefined ) {
        Severity: Major
        Found in js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js and 1 other location - About 1 day to fix
        js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js on lines 6594..6623

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

        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

            _setOptions: function( options ) {
                var closeButtonLocation, closeButtonText,
                    currentOpts = this.options;
        
                if ( options.corners !== undefined ) {
        Severity: Major
        Found in js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js and 1 other location - About 1 day to fix
        js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js on lines 6743..6772

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

        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 Services_User_Record.php has 564 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        class Services_User_Record
        {
            private $_sessionDao;
        Severity: Major
        Found in lib/services/User/Services_User_Record.php - About 1 day to fix

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

              public function process($hdrList, $curArtNr, $increment, $timer)
              {
                  $this->displayStatus('progress', $curArtNr.' till '.$increment);
          
                  $lastProcessedId = '';
          Severity: Minor
          Found in lib/services/Retriever/Services_Retriever_Comments.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 edituserprefs.inc.php has 551 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
              require __DIR__.'/includes/form-messages.inc.php';
          
              $pagetitle = _('Change user preferences');
          
          
          Severity: Major
          Found in templates/we1rdo/edituserprefs.inc.php - About 1 day to fix

            File SpotStruct_abs.php has 540 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            abstract class SpotStruct_abs
            {
                protected $_dbcon;
            Severity: Major
            Found in lib/dbstruct/SpotStruct_abs.php - About 1 day to fix

              File SpotCategories.php has 533 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              class SpotCategories
              {
                  private static $_namesTranslated = false;
              Severity: Major
              Found in lib/SpotCategories.php - About 1 day to fix

                File Services_Search_QueryParser.php has 532 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                class Services_Search_QueryParser
                {
                    /*
                Severity: Major
                Found in lib/services/Search/Services_Search_QueryParser.php - About 1 day to fix

                  Function showResults has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function showResults($spots, $offset, $outputtype)
                      {
                          $nzbhandling = $this->_currentSession['user']['prefs']['nzbhandling'];
                  
                          if ($outputtype == 'json') {
                  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

                  Severity
                  Category
                  Status
                  Source
                  Language