e107inc/e107

View on GitHub
e107_admin/upload.php

Summary

Maintainability
A
30 mins
Test Coverage
F
15%

Avoid too many return statements within this method.
Open

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

    Reference to undeclared constant \ADMIN_FALSE_ICON
    Open

                    return $value ? ADMIN_TRUE_ICON : ADMIN_FALSE_ICON;
    Severity: Minor
    Found in e107_admin/upload.php by phan

    Argument 4 (options) is array{other:'style="padding-left: 15px"'} but \upload_form_ui::option() takes string defined at /code/e107_handlers/form_handler.php:3604
    Open

                        $text .=  $this->option($diz, 'send_to_'.$k, false, array('other' => 'style="padding-left: 15px"'));
    Severity: Minor
    Found in e107_admin/upload.php by phan

    Argument 4 (options) is array{other:'style="padding-left: 15px"'} but \upload_form_ui::option() takes string defined at /code/e107_handlers/form_handler.php:3604
    Open

                    $text =  $this->option(LAN_ACCEPT, 'upload_active', false, array('other' => 'style="padding-left: 15px"'));
    Severity: Minor
    Found in e107_admin/upload.php by phan

    Call to deprecated function \getperms() defined at /code/class2.php:1322
    Open

    if (!getperms('V')) 
    Severity: Minor
    Found in e107_admin/upload.php by phan

    Assigning array<string></string> to property but \upload_ui->fields is array{checkboxes:array{title:'',type:null,width:'5%',thclass:'center',forced:true,class:'center',toggle:'e-multiselect'},upload_id:array{title:'ID',data:'int',width:'5%',help:'',readParms:'',writeParms:'',class:'left',thclass:'left'},upload_datestamp:array{title:'Date stamp',type:'datestamp',data:'int',width:'15%',filter:true,help:'',readParms:'',writeParms:'',class:'left',thclass:'left'},upload_name:array{title:'Title',type:'text',data:'str',width:'15%',help:'',readParms:'',writeParms:'',class:'left',thclass:'left',validate:true,inline:true},upload_email:array{title:'Email address',type:'text',data:'str',width:'auto',help:'',readParms:'',writeParms:'',class:'center',thclass:'center'},upload_website:array{title:'URL',type:'url',data:'str',width:'auto',help:'',readParms:'',writeParms:'',class:'left',thclass:'left'},upload_version:array{title:'Version',type:'text',data:'str',width:'auto',help:'',readParms:'',writeParms:'',class:'center',thclass:'center'},upload_file:array{title:'File',type:'text',data:'str',width:'15%',help:'',readParms:'',writeParms:'',class:'left',thclass:'left',validate:true},upload_ss:array{title:'Ss',type:'text',data:'str',width:'auto',help:'',readParms:'',writeParms:'',class:'center',thclass:'center'},upload_description:array{title:'Description',type:'textarea',data:'str',width:'30%',help:'',readParms:'',writeParms:'',class:'left',thclass:'left'},upload_poster:array{title:'Poster',type:'user',data:'int',width:'auto',help:'',readParms:'',writeParms:'',class:'center',thclass:'center'},upload_demo:array{title:'Demo',type:'url',data:'str',width:'auto',help:'',readParms:'',writeParms:'',class:'center',thclass:'center'},upload_filesize:array{title:'Size',type:'method',data:'int',width:'auto',help:'',readParms:'',writeParms:'',class:'center',thclass:'center'},upload_active:array{title:'Imported',type:'method',data:'int',width:'auto',help:'',readParms:'',writeParms:array{singleOption:true},class:'center',thclass:'center',batch:true,filter:true},upload_category:array{title:'Category',type:'method',data:'int',width:'auto',batch:true,filter:true,help:'',readParms:array{},writeParms:array{},class:'left',thclass:'left',validate:true},upload_owner:array{title:'Owner',type:'text',readonly:true,data:'str',width:'10%',help:'',readParms:'',writeParms:'',class:'left',thclass:'left'},options:array{title:'Options',type:'',data:'',width:'140px',thclass:'center last',class:'center last',forced:'1'}}
    Open

                            $this->fields['upload_category']['writeParms'][$label][$sub_id] = $_label;
    Severity: Minor
    Found in e107_admin/upload.php by phan

    Reference to undeclared property \e_admin_ui->categories
    Open

            $opts =  $this->getController()->categories;
    Severity: Minor
    Found in e107_admin/upload.php by phan

    Assigning array<string></string> to property but \upload_ui->fields is array{checkboxes:array{title:'',type:null,width:'5%',thclass:'center',forced:true,class:'center',toggle:'e-multiselect'},upload_id:array{title:'ID',data:'int',width:'5%',help:'',readParms:'',writeParms:'',class:'left',thclass:'left'},upload_datestamp:array{title:'Date stamp',type:'datestamp',data:'int',width:'15%',filter:true,help:'',readParms:'',writeParms:'',class:'left',thclass:'left'},upload_name:array{title:'Title',type:'text',data:'str',width:'15%',help:'',readParms:'',writeParms:'',class:'left',thclass:'left',validate:true,inline:true},upload_email:array{title:'Email address',type:'text',data:'str',width:'auto',help:'',readParms:'',writeParms:'',class:'center',thclass:'center'},upload_website:array{title:'URL',type:'url',data:'str',width:'auto',help:'',readParms:'',writeParms:'',class:'left',thclass:'left'},upload_version:array{title:'Version',type:'text',data:'str',width:'auto',help:'',readParms:'',writeParms:'',class:'center',thclass:'center'},upload_file:array{title:'File',type:'text',data:'str',width:'15%',help:'',readParms:'',writeParms:'',class:'left',thclass:'left',validate:true},upload_ss:array{title:'Ss',type:'text',data:'str',width:'auto',help:'',readParms:'',writeParms:'',class:'center',thclass:'center'},upload_description:array{title:'Description',type:'textarea',data:'str',width:'30%',help:'',readParms:'',writeParms:'',class:'left',thclass:'left'},upload_poster:array{title:'Poster',type:'user',data:'int',width:'auto',help:'',readParms:'',writeParms:'',class:'center',thclass:'center'},upload_demo:array{title:'Demo',type:'url',data:'str',width:'auto',help:'',readParms:'',writeParms:'',class:'center',thclass:'center'},upload_filesize:array{title:'Size',type:'method',data:'int',width:'auto',help:'',readParms:'',writeParms:'',class:'center',thclass:'center'},upload_active:array{title:'Imported',type:'method',data:'int',width:'auto',help:'',readParms:'',writeParms:array{singleOption:true},class:'center',thclass:'center',batch:true,filter:true},upload_category:array{title:'Category',type:'method',data:'int',width:'auto',batch:true,filter:true,help:'',readParms:array{},writeParms:array{},class:'left',thclass:'left',validate:true},upload_owner:array{title:'Owner',type:'text',readonly:true,data:'str',width:'10%',help:'',readParms:'',writeParms:'',class:'left',thclass:'left'},options:array{title:'Options',type:'',data:'',width:'140px',thclass:'center last',class:'center last',forced:'1'}}
    Open

                            $this->fields['upload_category']['writeParms'][$sub_id] = $label.' / '.$_label;
    Severity: Minor
    Found in e107_admin/upload.php by phan

    Argument 3 (opts) is string but \e_media::importFile() takes array|null defined at /code/e107_handlers/media_class.php:1357
    Open

                $imagePath = $media->importFile($upload['upload_ss'], $mediaImage, $uploadPath.$upload['upload_ss'], array('media_caption' => $upload['upload_name'].' '.LAN_PREVIEW));
    Severity: Minor
    Found in e107_admin/upload.php by phan

    Reference to undeclared constant \ADMIN_TRUE_ICON
    Open

                    return $value ? ADMIN_TRUE_ICON : ADMIN_FALSE_ICON;
    Severity: Minor
    Found in e107_admin/upload.php by phan

    Argument 2 (replace) is int|true but \str_replace() takes array|string
    Open

                    $url = str_replace('{ID}',$did, $config['url']);
    Severity: Minor
    Found in e107_admin/upload.php by phan

    Argument 3 (opts) is string but \e_media::importFile() takes array|null defined at /code/e107_handlers/media_class.php:1357
    Open

            $downloadPath = $media->importFile($upload['upload_file'], $mediaFile, $uploadPath.$upload['upload_file'], array('media_caption' => $upload['upload_name']));
    Severity: Minor
    Found in e107_admin/upload.php by phan

    There are no issues that match your filters.

    Category
    Status