spotweb/spotweb

View on GitHub

Showing 668 of 850 total issues

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

            Function filterValuesToSql has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
            Open

                private function filterValuesToSql($filterValueList, $currentSession)
                {
                    SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
            
                    // Add a list of possible text searches
            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

            Function updateSchema has a Cognitive Complexity of 51 (exceeds 5 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: Minor
            Found in lib/dbstruct/SpotStruct_abs.php - About 7 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 perform has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
            Open

                public function perform($url, $lastModTime = null, $redirTries = 0)
                {
                    SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
            
                    /*
            Severity: Minor
            Found in lib/services/Providers/Services_Providers_Http.php - About 7 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 _registerInternalEvents has 183 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                $.mobile._registerInternalEvents = function() {
                    var getAjaxFormData = function( $form, calculateOnly ) {
                        var url, ret = true, formData, vclickedName, method;
                        if ( !$.mobile.ajaxEnabled ||
                                // test that the form is, itself, ajax false
            Severity: Major
            Found in js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js - About 7 hrs to fix

              Function validateUserPreferences has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function validateUserPreferences($prefs, $currentPrefs)
                  {
                      $result = new Dto_FormResult();
              
                      // Define several arrays with valid settings
              Severity: Minor
              Found in lib/services/User/Services_User_Record.php - About 7 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 search has 176 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function search($outputtype)
                  {
                      // Check users' permissions
                      $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_perform_search, '');
              
              
              Severity: Major
              Found in lib/page/SpotPage_newznabapi.php - About 7 hrs to fix

                File Dao_Base_Cache.php has 454 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                class Dao_Base_Cache implements Dao_Cache
                {
                    private $_cachePath = '';
                Severity: Minor
                Found in lib/dao/Base/Dao_Base_Cache.php - About 6 hrs to fix

                  Function askNntpSettings has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function askNntpSettings()
                      {
                          global $settings;
                  
                          // Loading the file directly seems to sometimes result in a weird error. GH issue #1861
                  Severity: Minor
                  Found in lib/SpotInstall.php - About 6 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 SpotPosting has 156 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function SpotPosting() {
                      this.commentForm = null;
                      this.reportForm = null;
                      this.uiStart = null;
                      this.uiDone = null;
                  Severity: Major
                  Found in js/posting/posting.js - About 6 hrs to fix

                    Method parseHeader has 152 lines of code (exceeds 25 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: Major
                    Found in lib/services/Format/Services_Format_Parsing.php - About 6 hrs to fix

                      Method showResults has 150 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function showResults($spots, $offset, $outputtype)
                          {
                              $nzbhandling = $this->_currentSession['user']['prefs']['nzbhandling'];
                      
                              if ($outputtype == 'json') {
                      Severity: Major
                      Found in lib/page/SpotPage_newznabapi.php - About 6 hrs to fix

                        Function updateUserRecord has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function updateUserRecord($user, array $groupList, $allowEditGroupMembership)
                            {
                                $result = new Dto_FormResult('success');
                                $spotUser = $this->getUser($user['userid']);
                        
                        
                        Severity: Minor
                        Found in lib/services/User/Services_User_Record.php - About 5 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 Services_Retriever_Spots.php has 412 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        
                        class Services_Retriever_Spots extends Services_Retriever_Base
                        {
                            /**
                        Severity: Minor
                        Found in lib/services/Retriever/Services_Retriever_Spots.php - About 5 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language