spotweb/spotweb

View on GitHub

Showing 668 of 850 total issues

Avoid too many return statements within this method.
Open

        return true;
Severity: Major
Found in lib/dbstruct/SpotStruct_abs.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return Logger::NOTICE;
    Severity: Major
    Found in lib/SpotDebug.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  case UPLOAD_ERR_EXTENSION: return 'Some PHP extension interfered with uploaded, please check your server config';
      Severity: Major
      Found in lib/services/Providers/Services_Providers_FileUpload.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return $spot;
        Severity: Major
        Found in lib/services/Format/Services_Format_Parsing.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      default: return 'unk: '.$_FILES[$this->_formName]['error'][$this->_fieldName];
          Severity: Major
          Found in lib/services/Providers/Services_Providers_FileUpload.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        case UPLOAD_ERR_CANT_WRITE: return 'Failed to write uploaded file to disk, please check your server config';
            Severity: Major
            Found in lib/services/Providers/Services_Providers_FileUpload.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return $spot;
              Severity: Major
              Found in lib/services/Format/Services_Format_Parsing.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return;
                Severity: Major
                Found in lib/gettext/Gettext_PHP.php - About 30 mins to fix

                  Function downloadSabnzbd has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function downloadSabnzbd(id,url, dltype) {
                      $(".sab_"+id).removeClass("succes").addClass("loading");
                      
                      /*
                       * Get the URL, do not rely on the result handler always
                  Severity: Minor
                  Found in templates/we1rdo/js/scripts.js - About 25 mins 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 isXsrfValid has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function isXsrfValid($form)
                      {
                          if (!isset($_POST[$form]['xsrfid'])) {
                              return false;
                          } // if
                  Severity: Minor
                  Found in lib/SpotReq.php - About 25 mins 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 render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function render()
                      {
                          $tplHelper = $this->_tplHelper;
                  
                          /* Make sure users has sufficient permission to perform this action */
                  Severity: Minor
                  Found in lib/page/SpotPage_statics.php - About 25 mins 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 connect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function connect($host, $user, $pass, $db, $port, $schema)
                      {
                          if (!$this->_conn instanceof PDO) {
                              if ($host[0] === '/') {
                                  $db_conn = 'unix_socket='.$host;
                  Severity: Minor
                  Found in lib/dbeng/dbeng_pdo_mysql.php - About 25 mins 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 fetchFullSpot has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function fetchFullSpot($msgId, $ourUserId)
                      {
                          SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
                  
                          /*
                  Severity: Minor
                  Found in lib/services/Providers/Services_Providers_FullSpot.php - About 25 mins 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 Cat2Desc has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function Cat2Desc($hcat, $cat)
                      {
                          $catList = explode('|', $cat);
                          $cat = $catList[0];
                  
                  
                  Severity: Minor
                  Found in lib/SpotCategories.php - About 25 mins 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 convertBmpImageStringToJpeg has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function convertBmpImageStringToJpeg($imageString, $dimensions)
                      {
                          /*
                           * If this fil is currently an BMP, change it to an
                           * JPG file
                  Severity: Minor
                  Found in lib/services/Image/Services_Image_BmpConverter.php - About 25 mins 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 arrayKeyToInForComments has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function arrayKeyToInForComments($ar)
                      {
                          $tmpList = '';
                  
                          if (!is_array($ar) || count($ar) == 0) {
                  Severity: Minor
                  Found in lib/dbeng/dbeng_abs.php - About 25 mins 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 getFullSpot has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getFullSpot(array $currentSession, $msgId, $markAsRead)
                      {
                          // Make sure user has access to the spot
                          $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_view_spotdetail, '');
                  
                  
                  Severity: Minor
                  Found in lib/services/Actions/Services_Actions_GetSpot.php - About 25 mins 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 time_ago has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function time_ago($date, $granularity = 2)
                      {
                          $difference = time() - $date;
                          $periods = ['decade' => 315360000,
                              'year'           => 31536000,
                  Severity: Minor
                  Found in lib/SpotTemplateHelper.php - About 25 mins 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 translateMultiple has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function translateMultiple($dstLanguage, $list, $field)
                      {
                          /*
                           * Try to obtain an translator token
                           */
                  Severity: Minor
                  Found in lib/services/Translation/Services_Translation_Microsoft.php - About 25 mins 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 retrieveInfo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function retrieveInfo()
                      {
                          $mediaInfo = new Dto_MediaInformation();
                          $mediaInfo->setValid(false);
                  
                  
                  Severity: Minor
                  Found in lib/services/MediaInformation/Services_MediaInformation_Tvmaze.php - About 25 mins 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