e107inc/e107

View on GitHub
e107_handlers/media_class.php

Summary

Maintainability
A
2 hrs
Test Coverage
F
39%

Avoid too many return statements within this method.
Open

            return $img_data['media_url'];    
Severity: Major
Found in e107_handlers/media_class.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return '{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}';
    Severity: Major
    Found in e107_handlers/media_class.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return $this->processAjaxImport($filePath, $_REQUEST); 
      Severity: Major
      Found in e107_handlers/media_class.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return false;
        Severity: Major
        Found in e107_handlers/media_class.php - About 30 mins to fix

          Suspicious array access to nullable ?array
          Open

                  $bbcode        = varset($option['bbcode']) ? $option['bbcode'] : null;
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Argument 2 (mode) is 'rel' but \e_parse::createConstants() takes int defined at /code/e107_handlers/e_parse_class.php:3255
          Open

                  if($sql->select("core_media","media_url","media_url LIKE '%".$tp->createConstants($newpath,'rel')."' LIMIT 1"))
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Argument 2 (options) is string but \e_parse::thumbUrl() takes array defined at /code/e107_handlers/e_parse_class.php:2531
          Open

                          $media_path     = ($w || $h) ? $tp->thumbUrl($im['media_url'], "&w={$w}") : $tp->thumbUrl($im['media_url']); // $tp->replaceConstants($im['media_url'],'full'); // max-size
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Argument 2 (options) is 'w=100' but \e_parse::thumbUrl() takes array defined at /code/e107_handlers/e_parse_class.php:2531
          Open

                      <img src='".e107::getParser()->thumbUrl($image, 'w=100', true)."' alt=\"".$diz."\" style='width: 50px' />
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Suspicious array access to nullable ?array
          Open

                  $limit         = varset($option['limit']) ? $option['limit'] : 20;
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
          Open

                          $onclicki = "parent.document.getElementById('{$tagid}').value = '{$im['media_url']}';
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Argument 2 (mode) is 'rel' but \e_parse::createConstants() takes int defined at /code/e107_handlers/e_parse_class.php:3255
          Open

                  $path = $tp->createConstants($epath, 'rel');
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Suspicious array access to nullable ?array
          Open

                  $search        = varset($option['search']) ? $option['search'] : null;
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Suspicious array access to nullable ?array
          Open

                          $err = (int) $_FILES['file']['error'];
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Argument 6 (orderby) is null but \e_media::getMedia() takes string defined at /code/e107_handlers/media_class.php:508
          Open

                  return $this->getMedia('image', $cat, $from, $amount, $search, $orderby);
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Suspicious array access to nullable ?array
          Open

                  $navMode    = varset($option['nav']) ? TRUE : FALSE;
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Call to method make from undeclared class \Intervention\Image\ImageManagerStatic
          Open

                      $thumb = Intervension::make($src);
          Severity: Critical
          Found in e107_handlers/media_class.php by phan

          Variable $categories was undeclared, but array fields are being added to it.
          Open

                      $categories[] = "'".$row['media_cat_category']."'";    
          Severity: Info
          Found in e107_handlers/media_class.php by phan

          Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
          Open

                      $onclick_clear = "parent.document.getElementById('{$tagid}').value = '';
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
          Open

                      $onclick_clear = "parent.document.getElementById('{$tagid}').value = '';
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Returning type string but resizeImage() is declared to return bool
          Open

                      return $destFilePath;
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Argument 3 (amount) is 'all' but \e_media::getImages() takes int defined at /code/e107_handlers/media_class.php:491
          Open

                  return $this->getImages($cat, 0, 'all',$search);
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
          Open

                  $prevId     = $tagid."_prev"; // ID of image in Form.
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Suspicious array access to nullable ?array
          Open

                  $prevAtt        = '&aw='.vartrue($option['w'],$w); // .'&ah=100';    // Image Parsed back to Form as PREVIEW image.     
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          array to string conversion
          Open

                      $text .= "<button id='admin-ui-media-nav-down' type='button' title='".IMALAN_130."' class='btn btn-default btn-secondary e-nav e-media-nav e-tip' style='outline:0' data-target='media-select-container' data-nav-total='".$total."' data-nav-dir='down' data-nav-inc='".$limit."' data-src='".$data_src."'>&laquo;</button>"; // see next page of images.
          Severity: Info
          Found in e107_handlers/media_class.php by phan

          Returning type false but convertImageToJpeg() is declared to return string
          Open

                          return false;
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Argument 2 (mode) is 'rel' but \e_parse::createConstants() takes int defined at /code/e107_handlers/e_parse_class.php:3255
          Open

                  $path = $tp->createConstants($epath, 'rel');
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Call to method make from undeclared class \Intervention\Image\ImageManagerStatic
          Open

                      $thumb = Intervension::make($filePath);
          Severity: Critical
          Found in e107_handlers/media_class.php by phan

          Argument 2 (mode) is 'rel' but \e_parse::createConstants() takes int defined at /code/e107_handlers/e_parse_class.php:3255
          Open

                      return $tp->createConstants($typePath.'/'.$file,'rel');
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Suspicious array access to nullable ?array
          Open

                  $frm         = varset($option['from']) ? $option['from'] : 0;
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
          Open

                      $text .= "<a data-toggle='context' data-bs-toggle='context' class='thumbnail {$class} e-tip' data-id='{$im['media_id']}' data-width='{$w}' data-height='{$h}' data-src='{$media_path}' data-bbcode='{$data_bb}' data-target='{$tagid}' data-path='{$im['media_url']}' data-preview='{$realPath}' data-alt=\"".$media_alt."\" title=\"".$diz."\" style='float:left' href='#' onclick=\"{$onclicki}\" >";
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Argument 2 (options) is string but \e_parse::thumbUrl() takes array defined at /code/e107_handlers/e_parse_class.php:2531
          Open

                          $realPath         = $tp->thumbUrl($im['media_url'], $prevAtt); // Parsed back to Form as Preview Image.
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Assigning int to property but \e_media->logging is false
          Open

                  $this->logging = intval($val);
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Variable $data was undeclared, but array fields are being added to it.
          Open

                      $data['media_cat_'.$k] = $v;
          Severity: Info
          Found in e107_handlers/media_class.php by phan

          Argument 2 (options) is 'aw=120&ah=120' but \e_parse::thumbUrl() takes array defined at /code/e107_handlers/e_parse_class.php:2531
          Open

                          $img_url        = e107::getParser()->thumbUrl($im['media_url'], $thumbAtt);
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Invalid offset "media_description" of array type array{}
          Open

                  $img_data['media_description']     = vartrue($new_data['media_description']);
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Argument 1 (search) is ?'.gif'|?'.png' but \str_replace() takes array|string
          Open

                  $jpgFile = str_replace($type, ".jpg", $oldFile);
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          float|int to array comparison
          Open

                  $dipTotal = (($frm + $limit) < $total) ? ($frm + $limit) : $total;
          Severity: Info
          Found in e107_handlers/media_class.php by phan

          Argument 2 (mode) is 'rel' but \e_parse::createConstants() takes int defined at /code/e107_handlers/e_parse_class.php:3255
          Open

                      'media_url'            => e107::getParser()->createConstants($info['fullpath'], 'rel'),
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          array to string conversion
          Open

                      $text .= "<button id='admin-ui-media-nav-up' type='button' title='".IMALAN_131."' class='btn btn-default btn-secondary e-nav e-media-nav e-tip' style='outline:0;text-align:center'  data-target='media-select-container' data-nav-total='".$total."' data-nav-dir='up' data-nav-inc='".$limit."' data-src='".$data_src."' >&raquo;</button>"; // see next page of images.
          Severity: Info
          Found in e107_handlers/media_class.php by phan

          Returning type ?array|?bool|?string but previewTag() is declared to return bool|string
          Open

                  return $preview;
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Argument 2 (mode) is 'rel' but \e_parse::createConstants() takes int defined at /code/e107_handlers/e_parse_class.php:3255
          Open

                  $img_data['media_url']            = $tp->createConstants($newpath,'rel');
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Argument 2 (options) is 'w=400&h=240' but \e_parse::thumbUrl() takes array defined at /code/e107_handlers/e_parse_class.php:2531
          Open

                  $defaultThumb = $tp->thumbUrl('','w=400&h=240');    
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Returning type string but resizeImage() is declared to return bool
          Open

                      return $destFilePath;
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
          Open

                  $mes->addDebug("Target: {$tagid}");
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Invalid offset "media_caption" of array type array{}
          Open

                  $img_data['media_caption']         = vartrue($new_data['media_caption']);
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          Returning type false but convertImageToJpeg() is declared to return string
          Open

                      return false;
          Severity: Minor
          Found in e107_handlers/media_class.php by phan

          There are no issues that match your filters.

          Category
          Status