spotweb/spotweb

View on GitHub

Showing 668 of 850 total issues

Method fetchSpotImage has 85 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function fetchSpotImage($fullSpot)
    {
        SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
        $return_code = 0;
        $validImage = false;
Severity: Major
Found in lib/services/Providers/Services_Providers_SpotImage.php - About 3 hrs to fix

    File sabpanel.js has 306 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // SabNZBd actions
    function sabBaseURL() {
        var apikey = $("div.sabnzbdPanel input.apikey").val();
        return createBaseURL()+'?page=nzbhandlerapi&nzbhandlerapikey='+apikey;
    }
    Severity: Minor
    Found in templates/we1rdo/js/sabpanel.js - About 3 hrs to fix

      Consider simplifying this complex logical expression.
      Open

          if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
              (t == 'checkbox' || t == 'radio') && !el.checked ||
              (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
              tag == 'select' && el.selectedIndex == -1)) {
                  return null;
      Severity: Critical
      Found in js/jquery/jquery.form.js - About 3 hrs to fix

        Function sha1 has 83 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    sha1: function(string) {
                        var blockstart;
                        var i, j;
                        var W = new Array(80);
                        var H0 = 0x67452301;
        Severity: Major
        Found in js/sha1/jquery.sha1.js - About 3 hrs to fix

          Method updateUserPreferences has 83 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function updateUserPreferences()
              {
                  $userList = $this->_userDao->getUserList();
          
                  // loop through every user and fix it
          Severity: Major
          Found in lib/services/Upgrade/Services_Upgrade_Users.php - About 3 hrs to fix

            File jquery.ui.nestedSortable.js has 304 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
             * jQuery UI Nested Sortable
             * v 1.3.5 / 21 jun 2012
             * http://mjsarfatti.com/code/nestedSortable
             *
            Severity: Minor
            Found in templates/we1rdo/js/jquery.ui.nestedSortable.js - About 3 hrs to fix

              Function refresh has 82 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  refresh: function( create ) {
                      var buttonClass, pos, numli, item, itemClass, itemTheme, itemIcon, icon, a,
                          isDivider, startCount, newStartCount, value, last, splittheme, splitThemeClass, spliticon,
                          altButtonClass, dividerTheme, li,
                          o = this.options,
              Severity: Major
              Found in js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js - About 3 hrs to fix

                Function build has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    build: function() {
                        var selectId, popupId, dialogId, label, thisPage, isMultiple, menuId,
                            themeAttr, overlayTheme, overlayThemeAttr, dividerThemeAttr,
                            menuPage, listbox, list, header, headerTitle, menuPageContent,
                            menuPageClose, headerClose,
                Severity: Major
                Found in js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.js - About 3 hrs to fix

                  File Services_Providers_Http.php has 303 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  class Services_Providers_Http
                  {
                      private $_cacheDao;
                  Severity: Minor
                  Found in lib/services/Providers/Services_Providers_Http.php - About 3 hrs to fix

                    Function getColumnInfo has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getColumnInfo($tablename, $colname)
                        {
                            $q = $this->_dbcon->arrayQuery("SELECT COLUMN_NAME, 
                                                                   COLUMN_DEFAULT, 
                                                                   IS_NULLABLE, 
                    Severity: Minor
                    Found in lib/dbstruct/SpotStruct_mysql.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 bmp2gd has a Cognitive Complexity of 23 (exceeds 5 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: Minor
                    Found in lib/services/Image/Services_Image_BmpConverter.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 displayStatus has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function displayStatus($cat, $txt)
                        {
                            switch ($cat) {
                                case 'start': echo 'Retrieving new Spots from server '.$txt.'...'.PHP_EOL;
                                    break;
                    Severity: Minor
                    Found in lib/services/Retriever/Services_Retriever_Spots.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 _load has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                _load = function() {
                                    if (!_loaded) {
                                        _loaded = TRUE;
                                        _options();
                                        var complete = function() {
                    Severity: Major
                    Found in templates/we1rdo/js/jquery.address.js - About 3 hrs to fix

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

                      function openDialog(divid, title, url, buttonClick, successAction, closeCb, openCb) {
                          var $dialdiv = $("#" + divid);
                      
                          /*
                           * Test whether we need to 'dialog'-ify the
                      Severity: Major
                      Found in templates/we1rdo/js/spotdialogs.js - About 3 hrs to fix

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

                            public function render()
                            {
                                // Make sure the proper permissions are met
                                $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_view_spotdetail, '');
                                $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_view_spots_index, '');
                        Severity: Major
                        Found in lib/page/SpotPage_rss.php - About 3 hrs to fix

                          Function toJSON has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  : function( o ) {
                          
                                  if ( o === null ) {
                                      return 'null';
                                  }
                          Severity: Major
                          Found in js/jquery-json/jquery.json-2.3.js - About 3 hrs to fix

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

                                public function renderSelectBox()
                                {
                                    /*
                                     * The categorylisting is very static, so ask the user to always cache
                                     */
                            Severity: Minor
                            Found in lib/page/SpotPage_catsjson.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 showNotificationOptions has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                                function showNotificationOptions($provider, $edituserprefsform, $tplHelper)
                                {
                                    echo '<fieldset>'.PHP_EOL;
                            
                                    if ($tplHelper->allowed(SpotSecurity::spotsec_send_notifications_types, 'watchlist_handled') && $tplHelper->allowed(SpotSecurity::spotsec_keep_own_watchlist, '')) {
                            Severity: Minor
                            Found in templates/we1rdo/edituserprefs.inc.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 xmlToFilters has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function xmlToFilters($xmlStr)
                                {
                                    $filterList = [];
                            
                                    /*
                            Severity: Minor
                            Found in lib/services/User/Services_User_Filters.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 verifyCategories has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function verifyCategories(Dto_FormResult $result)
                                {
                                    $spot = $result->getData('spot');
                            
                                    /* Make sure the category is valid
                            Severity: Minor
                            Found in lib/services/Posting/Services_Posting_Validator.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

                            Severity
                            Category
                            Status
                            Source
                            Language