spotweb/spotweb

View on GitHub

Showing 668 of 850 total issues

Function parse has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    private function parse($locale, $domain)
    {
        $this->translationTable[$locale][$domain] = [];
        $mofile = sprintf('%s/%s/LC_MESSAGES/%s.mo', $this->dir, $locale, $domain);
        $cachefile = sprintf('%s/%s/LC_MESSAGES/%s.ser', $this->dir, $locale, $domain);
Severity: Minor
Found in lib/gettext/Gettext_PHP.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 filters.inc.php has 329 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
    SpotTiming::start('tpl:filters');

    // We definieeren hier een aantal settings zodat we niet steeds dezelfde check hoeven uit te voeren
    $count_newspots = ($currentSession['user']['prefs']['count_newspots']);
Severity: Minor
Found in templates/we1rdo/includes/filters.inc.php - About 3 hrs to fix

    Method categoriesToJson has 97 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function categoriesToJson()
        {
            /*
             * Don't allow the tree to be cached, it contains the current state of the
             * tree
    Severity: Major
    Found in lib/page/SpotPage_catsjson.php - About 3 hrs to fix

      File spots.inc.php has 327 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
          /* Render de header en filter templates */
          if (!isset($data['spotsonly'])) {
              require_once __DIR__.'/includes/header.inc.php';
      Severity: Minor
      Found in templates/we1rdo/spots.inc.php - About 3 hrs to fix

        Method prepareCategorySelection has 95 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function prepareCategorySelection($dynaList)
            {
                SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
        
                $strongNotList = [];
        Severity: Major
        Found in lib/services/Search/Services_Search_QueryParser.php - About 3 hrs to fix

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

              public function render()
              {
                  // Make sure the user has the appropriate permissions
                  $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_use_sabapi, '');
          
          
          Severity: Minor
          Found in lib/page/SpotPage_nzbhandlerapi.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

          Function converttoubb has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

              public function converttoubb($parseresult, $allowedchildren = [null])
              {
                  $output = [''];
                  $bodycount = 0;
          
          
          Severity: Minor
          Found in lib/ubb/SpotUbb_parser.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

          Function fetchSpotImage has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

              public function fetchSpotImage($fullSpot)
              {
                  SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
                  $return_code = 0;
                  $validImage = false;
          Severity: Minor
          Found in lib/services/Providers/Services_Providers_SpotImage.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 askNntpSettings has 93 lines of code (exceeds 25 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: Major
          Found in lib/SpotInstall.php - About 3 hrs to fix

            Method parseFull has 92 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function parseFull($xmlStr)
                {
                    // Create a template array so we always have the full fields to prevent ugly notices
                    $tpl_spot = ['category' => '', 'website' => '', 'image' => '', 'sabnzbdurl' => '', 'messageid' => '', 'searchurl' => '', 'description' => '',
                        'sub'               => '', 'filesize' => '', 'poster' => '', 'tag' => '', 'nzb' => [], 'title' => '',
            Severity: Major
            Found in lib/services/Format/Services_Format_Parsing.php - About 3 hrs to fix

              Method bmp2gd has 91 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function bmp2gd($src, $dest = false)
                  {
                      /*** try to open the file for reading ***/
                      if (!($src_f = fopen($src, 'rb'))) {
                          return false;
              Severity: Major
              Found in lib/services/Image/Services_Image_BmpConverter.php - About 3 hrs to fix

                Function openDialog has a Cognitive Complexity of 25 (exceeds 5 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: Minor
                Found in templates/mobile/includes/js/spotdialogs.js - 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

                Function strongNotListToSql has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                Open

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

                Function updateExternalList has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function updateExternalList($newlist, $idtype)
                    {
                        $updatelist = [];
                        $updskipped = 0;
                        $countnewlistspotterid = 0;
                Severity: Minor
                Found in lib/dao/Base/Dao_Base_BlackWhiteList.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 render has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function render()
                    {
                        // Make sure the user has the appropriate permissions
                        $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_use_sabapi, '');
                
                
                Severity: Major
                Found in lib/page/SpotPage_nzbhandlerapi.php - About 3 hrs to fix

                  Dao_Base_Spot has 29 functions (exceeds 20 allowed). Consider refactoring.
                  Open

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

                    Method render has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function render()
                        {
                            $result = new Dto_FormResult('notsubmitted');
                    
                            // Make sure the user has the appropriate rights
                    Severity: Major
                    Found in lib/page/SpotPage_editfilter.php - About 3 hrs to fix

                      Function SpotPosting has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function SpotPosting() {
                          this.commentForm = null;
                          this.reportForm = null;
                          this.uiStart = null;
                          this.uiDone = null;
                      Severity: Minor
                      Found in js/posting/posting.js - 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

                      Function sendMessages has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function sendMessages($userId)
                          {
                              $userDao = $this->_daoFactory->getUserDao();
                              $notificationDao = $this->_daoFactory->getNotificationDao();
                      
                      
                      Severity: Minor
                      Found in lib/SpotNotifications.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

                      Function _buildList has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _buildList: function() {
                              var self = this,
                                  o = this.options,
                                  placeholder = this.placeholder,
                                  needPlaceholder = true,
                      Severity: Major
                      Found in js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language