e107inc/e107

View on GitHub
e107_admin/links.php

Summary

Maintainability
A
0 mins
Test Coverage
F
46%

Assigning array<string in same window new mini-window></string> to property but \links_admin_ui->fields is array{checkboxes:array{title:'',width:'3%',forced:true,thclass:'center first',class:'center first'},link_button:array{title:'Icon',type:'icon',width:'5%',thclass:'center',class:'center',readParms:array{legacy:'\x7be_IMAGE\x7dicons/'},writeParms:'glyphs=1'},link_id:array{title:'ID',type:'method',readParms:'',noedit:true},link_name:array{title:'Name',type:'text',inline:true,required:false,validate:false,width:'auto',writeParms:array{size:'xlarge'}},link_category:array{title:'Template',type:'dropdown',inline:true,batch:true,filter:true,width:'auto',writeParms:array{size:'xlarge'}},link_parent:array{title:'Parent',type:'method',data:'int',width:'auto',batch:true,filter:true,thclass:'left first',writeParms:array{size:'xlarge'}},link_url:array{title:'URL',width:'auto',type:'method',inline:true,required:true,validate:true,writeParms:'size=xxlarge'},link_sefurl:array{title:'SEF URL',type:'method',inline:false,width:'auto',help:'Enable to override URL with a dynamically created Search-Engine-Friendly URL'},link_class:array{title:'Userclass',type:'userclass',inline:true,writeParms:'classlist=public,guest,nobody,member,classes,admin,main',batch:true,filter:true,width:'auto'},link_description:array{title:'Description',type:'textarea',width:'auto'},link_order:array{title:'Order',type:'number',width:'auto',nolist:false,inline:true},link_open:array{title:'Link Open Type',type:'dropdown',inline:true,width:'auto',batch:true,filter:true,thclass:'left first',writeParms:array{size:'xlarge'}},link_rel:array{title:'Relationship',type:'tags',inline:true,width:'auto',batch:false,filter:false,thclass:'left',help:'Optional \'rel\' attribute. Comma separated.',writeParms:array{placeholder:'eg.nofollow,noreferrer',size:'xlarge'}},link_function:array{title:'Function',type:'method',data:'str',width:'auto',thclass:'left first'},link_owner:array{title:'Owned by',type:'hidden',filter:true,data:'str'},options:array{title:'Options',type:null,forced:true,width:'10%',thclass:'center last',class:'center',readParms:'sort=1'}}
Open

        $this->fields['link_open']['writeParms']['optArray'] = array(
Severity: Minor
Found in e107_admin/links.php by phan

null passed to foreach instead of array
Open

            foreach ($sublink['result'] as $row)
Severity: Minor
Found in e107_admin/links.php by phan

When fetching an array index from a value of type 'Download Categories'|'News Categories \x28List\x29'|'News Categories'|'category_icon'|'category_id !=\'-2\' ORDER BY category_name ASC'|'category_id'|'category_name'|'download.php?list.#'|'download_category'|'download_category_icon'|'download_category_id'|'download_category_name'|'download_category_parent =\'0\' ORDER BY download_category_name ASC'|'news.php?cat.#'|'news.php?list.#'|'news/list/category'|'news/list/short'|'news_category', found an array index of type 'category_name'|'download_category_name', but expected the index to be of type int
Open

                $name = $row[($sublink['fieldname'])];
Severity: Minor
Found in e107_admin/links.php by phan

Call to undeclared method \e_admin_ui::getLinkArray
Open

                $cats    = $this->getController()->getLinkArray($catid);
Severity: Critical
Found in e107_admin/links.php by phan

Invalid offset "result" of array type array{downloads:array{fieldicon:'download_category_icon'}}|array{downloads:array{fieldid:'download_category_id'}}|array{downloads:array{fieldname:'download_category_name'}}|array{downloads:array{query:'download_category_parent =\'0\' ORDER BY download_category_name ASC'}}|array{downloads:array{table:'download_category'}}|array{downloads:array{title:'Download Categories'}}|array{downloads:array{url:'download.php?list.#'}}|array{fieldicon:'category_icon'}|array{fieldicon:'download_category_icon'}|array{fieldid:'category_id'}|array{fieldid:'download_category_id'}|array{fieldname:'category_name'}|array{fieldname:'download_category_name'}|array{newsalt:array{fieldicon:'category_icon'}|array{fieldid:'category_id'}|array{fieldname:'category_name'}|array{query:'category_id !=\'-2\' ORDER BY category_name ASC'}|array{sef:'news/list/category'}|array{table:'news_category'}|array{title:'News Categories'}|array{url:'news.php?list.#'},news:array{fieldicon:'category_icon'}|array{fieldid:'category_id'}|array{fieldname:'category_name'}|array{query:'category_id !=\'-2\' ORDER BY category_name ASC'}|array{sef:'news/list/category'}|array{table:'news_category'}|array{title:'News Categories'}|array{url:'news.php?list.#'}}|array{newsalt:array{sef:'news/list/short'}}|array{newsalt:array{title:'News Categories \x28List\x29'}}|array{newsalt:array{url:'news.php?cat.#'}}|array{query:'category_id !=\'-2\' ORDER BY category_name ASC'}|array{query:'download_category_parent =\'0\' ORDER BY download_category_name ASC'}|array{sef:'news/list/category'}|array{sef:'news/list/short'}|array{table:'download_category'}|array{table:'news_category'}|array{title:'Download Categories'}|array{title:'News Categories \x28List\x29'}|array{title:'News Categories'}|array{url:'download.php?list.#'}|array{url:'news.php?cat.#'}|array{url:'news.php?list.#'}
Open

        if(vartrue($sublink['result']))
Severity: Minor
Found in e107_admin/links.php by phan

When fetching an array index from a value of type 'Download Categories'|'News Categories \x28List\x29'|'News Categories'|'category_icon'|'category_id !=\'-2\' ORDER BY category_name ASC'|'category_id'|'category_name'|'download.php?list.#'|'download_category'|'download_category_icon'|'download_category_id'|'download_category_name'|'download_category_parent =\'0\' ORDER BY download_category_name ASC'|'news.php?cat.#'|'news.php?list.#'|'news/list/category'|'news/list/short'|'news_category', found an array index of type 'category_icon'|'download_category_icon', but expected the index to be of type int
Open

                $subicon = ($sublink['fieldicon']) ? $row[($sublink['fieldicon'])] : $par['link_button'];
Severity: Minor
Found in e107_admin/links.php by phan

Call to undeclared method \e_admin_form_ui::link_parent
Open

        $text .= $ui->link_parent($this->getPosted('link_parent'), 'write');
Severity: Critical
Found in e107_admin/links.php by phan

Call to undeclared method \e_admin_form_ui::_has_parent
Open

            if($ui->_has_parent($value, $id, $this->getLinkArray()))
Severity: Critical
Found in e107_admin/links.php by phan

Argument 2 (tree_models) is array<string>|array<string>|array<string>|array<string>|array<string>|array<string>|array<string>|array{}</string></string></string></string></string></string></string> but \links_admin_form_ui::renderListForm() takes \e_admin_tree_model defined at /code/e107_handlers/form_handler.php:7380
Open

        return $this->renderListForm($options, $tree, $ajax);
Severity: Minor
Found in e107_admin/links.php by phan

Invalid offset "fielddiz" of array type array{downloads:array{fieldicon:'download_category_icon'}}|array{downloads:array{fieldid:'download_category_id'}}|array{downloads:array{fieldname:'download_category_name'}}|array{downloads:array{query:'download_category_parent =\'0\' ORDER BY download_category_name ASC'}}|array{downloads:array{table:'download_category'}}|array{downloads:array{title:'Download Categories'}}|array{downloads:array{url:'download.php?list.#'}}|array{fieldicon:'category_icon'}|array{fieldicon:'download_category_icon'}|array{fieldid:'category_id'}|array{fieldid:'download_category_id'}|array{fieldname:'category_name'}|array{fieldname:'download_category_name'}|array{newsalt:array{fieldicon:'category_icon'}|array{fieldid:'category_id'}|array{fieldname:'category_name'}|array{query:'category_id !=\'-2\' ORDER BY category_name ASC'}|array{sef:'news/list/category'}|array{table:'news_category'}|array{title:'News Categories'}|array{url:'news.php?list.#'},news:array{fieldicon:'category_icon'}|array{fieldid:'category_id'}|array{fieldname:'category_name'}|array{query:'category_id !=\'-2\' ORDER BY category_name ASC'}|array{sef:'news/list/category'}|array{table:'news_category'}|array{title:'News Categories'}|array{url:'news.php?list.#'}}|array{newsalt:array{sef:'news/list/short'}}|array{newsalt:array{title:'News Categories \x28List\x29'}}|array{newsalt:array{url:'news.php?cat.#'}}|array{query:'category_id !=\'-2\' ORDER BY category_name ASC'}|array{query:'download_category_parent =\'0\' ORDER BY download_category_name ASC'}|array{sef:'news/list/category'}|array{sef:'news/list/short'}|array{table:'download_category'}|array{table:'news_category'}|array{title:'Download Categories'}|array{title:'News Categories \x28List\x29'}|array{title:'News Categories'}|array{url:'download.php?list.#'}|array{url:'news.php?cat.#'}|array{url:'news.php?list.#'}
Open

                $subdiz = ($sublink['fielddiz']) ? $row[($sublink['fielddiz'])] : $par['link_description'];
Severity: Minor
Found in e107_admin/links.php by phan

Call to undeclared method \e_admin_ui::getLinkArray
Open

                $cats    = $this->getController()->getLinkArray();
Severity: Critical
Found in e107_admin/links.php by phan

Assigning array<string main sidebar footer></string> to property but \links_admin_ui->fields is array{checkboxes:array{title:'',width:'3%',forced:true,thclass:'center first',class:'center first'},link_button:array{title:'Icon',type:'icon',width:'5%',thclass:'center',class:'center',readParms:array{legacy:'\x7be_IMAGE\x7dicons/'},writeParms:'glyphs=1'},link_id:array{title:'ID',type:'method',readParms:'',noedit:true},link_name:array{title:'Name',type:'text',inline:true,required:false,validate:false,width:'auto',writeParms:array{size:'xlarge'}},link_category:array{title:'Template',type:'dropdown',inline:true,batch:true,filter:true,width:'auto',writeParms:array{size:'xlarge'}},link_parent:array{title:'Parent',type:'method',data:'int',width:'auto',batch:true,filter:true,thclass:'left first',writeParms:array{size:'xlarge'}},link_url:array{title:'URL',width:'auto',type:'method',inline:true,required:true,validate:true,writeParms:'size=xxlarge'},link_sefurl:array{title:'SEF URL',type:'method',inline:false,width:'auto',help:'Enable to override URL with a dynamically created Search-Engine-Friendly URL'},link_class:array{title:'Userclass',type:'userclass',inline:true,writeParms:'classlist=public,guest,nobody,member,classes,admin,main',batch:true,filter:true,width:'auto'},link_description:array{title:'Description',type:'textarea',width:'auto'},link_order:array{title:'Order',type:'number',width:'auto',nolist:false,inline:true},link_open:array{title:'Link Open Type',type:'dropdown',inline:true,width:'auto',batch:true,filter:true,thclass:'left first',writeParms:array{size:'xlarge'}},link_rel:array{title:'Relationship',type:'tags',inline:true,width:'auto',batch:false,filter:false,thclass:'left',help:'Optional \'rel\' attribute. Comma separated.',writeParms:array{placeholder:'eg.nofollow,noreferrer',size:'xlarge'}},link_function:array{title:'Function',type:'method',data:'str',width:'auto',thclass:'left first'},link_owner:array{title:'Owned by',type:'hidden',filter:true,data:'str'},options:array{title:'Options',type:null,forced:true,width:'10%',thclass:'center last',class:'center',readParms:'sort=1'}}
Open

        $this->fields['link_category']['writeParms']['optArray'] = array(
Severity: Minor
Found in e107_admin/links.php by phan

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

                $ret[0]    = $mode == 'batch' ? 'REMOVE PARENT' : 'Main Only';
Severity: Info
Found in e107_admin/links.php by phan

Assigning array<string></string> to property but \links_admin_ui->fields is array{checkboxes:array{title:'',width:'3%',forced:true,thclass:'center first',class:'center first'},link_button:array{title:'Icon',type:'icon',width:'5%',thclass:'center',class:'center',readParms:array{legacy:'\x7be_IMAGE\x7dicons/'},writeParms:'glyphs=1'},link_id:array{title:'ID',type:'method',readParms:'',noedit:true},link_name:array{title:'Name',type:'text',inline:true,required:false,validate:false,width:'auto',writeParms:array{size:'xlarge'}},link_category:array{title:'Template',type:'dropdown',inline:true,batch:true,filter:true,width:'auto',writeParms:array{size:'xlarge'}},link_parent:array{title:'Parent',type:'method',data:'int',width:'auto',batch:true,filter:true,thclass:'left first',writeParms:array{size:'xlarge'}},link_url:array{title:'URL',width:'auto',type:'method',inline:true,required:true,validate:true,writeParms:'size=xxlarge'},link_sefurl:array{title:'SEF URL',type:'method',inline:false,width:'auto',help:'Enable to override URL with a dynamically created Search-Engine-Friendly URL'},link_class:array{title:'Userclass',type:'userclass',inline:true,writeParms:'classlist=public,guest,nobody,member,classes,admin,main',batch:true,filter:true,width:'auto'},link_description:array{title:'Description',type:'textarea',width:'auto'},link_order:array{title:'Order',type:'number',width:'auto',nolist:false,inline:true},link_open:array{title:'Link Open Type',type:'dropdown',inline:true,width:'auto',batch:true,filter:true,thclass:'left first',writeParms:array{size:'xlarge'}},link_rel:array{title:'Relationship',type:'tags',inline:true,width:'auto',batch:false,filter:false,thclass:'left',help:'Optional \'rel\' attribute. Comma separated.',writeParms:array{placeholder:'eg.nofollow,noreferrer',size:'xlarge'}},link_function:array{title:'Function',type:'method',data:'str',width:'auto',thclass:'left first'},link_owner:array{title:'Owned by',type:'hidden',filter:true,data:'str'},options:array{title:'Options',type:null,forced:true,width:'10%',thclass:'center last',class:'center',readParms:'sort=1'}}
Open

        $this->fields['link_owner']['type'] = 'method';
Severity: Minor
Found in e107_admin/links.php by phan

When fetching an array index from a value of type 'Download Categories'|'News Categories \x28List\x29'|'News Categories'|'category_icon'|'category_id !=\'-2\' ORDER BY category_name ASC'|'category_id'|'category_name'|'download.php?list.#'|'download_category'|'download_category_icon'|'download_category_id'|'download_category_name'|'download_category_parent =\'0\' ORDER BY download_category_name ASC'|'news.php?cat.#'|'news.php?list.#'|'news/list/category'|'news/list/short'|'news_category', found an array index of type 'Download Categories'|'News Categories \x28List\x29'|'News Categories'|'category_icon'|'category_id !=\'-2\' ORDER BY category_name ASC'|'category_id'|'category_name'|'download.php?list.#'|'download_category'|'download_category_icon'|'download_category_id'|'download_category_name'|'download_category_parent =\'0\' ORDER BY download_category_name ASC'|'news.php?cat.#'|'news.php?list.#'|'news/list/category'|'news/list/short'|'news_category'|array{fieldicon:'category_icon'}|array{fieldicon:'download_category_icon'}|array{fieldid:'category_id'}|array{fieldid:'download_category_id'}|array{fieldname:'category_name'}|array{fieldname:'download_category_name'}|array{query:'category_id !=\'-2\' ORDER BY category_name ASC'}|array{query:'download_category_parent =\'0\' ORDER BY download_category_name ASC'}|array{sef:'news/list/category'}|array{sef:'news/list/short'}|array{table:'download_category'}|array{table:'news_category'}|array{title:'Download Categories'}|array{title:'News Categories \x28List\x29'}|array{title:'News Categories'}|array{url:'download.php?list.#'}|array{url:'news.php?cat.#'}|array{url:'news.php?list.#'}, but expected the index to be of type int
Open

                $subdiz = ($sublink['fielddiz']) ? $row[($sublink['fielddiz'])] : $par['link_description'];
Severity: Minor
Found in e107_admin/links.php by phan

Argument 2 (parseBB) is '' but \e_parse::toHTML() takes bool|false defined at /code/e107_handlers/e_parse_class.php:1532
Open

                $func[$newkey] = $tp->toHTML($val['name'],'','TITLE');
Severity: Minor
Found in e107_admin/links.php by phan

When fetching an array index from a value of type 'Download Categories'|'News Categories \x28List\x29'|'News Categories'|'category_icon'|'category_id !=\'-2\' ORDER BY category_name ASC'|'category_id'|'category_name'|'download.php?list.#'|'download_category'|'download_category_icon'|'download_category_id'|'download_category_name'|'download_category_parent =\'0\' ORDER BY download_category_name ASC'|'news.php?cat.#'|'news.php?list.#'|'news/list/category'|'news/list/short'|'news_category', found an array index of type 'category_id'|'download_category_id', but expected the index to be of type int
Open

                $subcat = $row[($sublink['fieldid'])];
Severity: Minor
Found in e107_admin/links.php by phan

Method \links_admin_form_ui::_parents is declared to return array but has no return value
Open

    function _parents($link_id, $search, &$src, $titles = true)
Severity: Minor
Found in e107_admin/links.php by phan

Saw an @param annotation for category_id, but it was not found in the param list of function _parents($link_id, array $search, array &$src, bool|true $titles = null) : array
Open

     * @param integer $category_id
Severity: Info
Found in e107_admin/links.php by phan

Invalid offset "fielddiz" of array type array{downloads:array{fieldicon:'download_category_icon'}}|array{downloads:array{fieldid:'download_category_id'}}|array{downloads:array{fieldname:'download_category_name'}}|array{downloads:array{query:'download_category_parent =\'0\' ORDER BY download_category_name ASC'}}|array{downloads:array{table:'download_category'}}|array{downloads:array{title:'Download Categories'}}|array{downloads:array{url:'download.php?list.#'}}|array{fieldicon:'category_icon'}|array{fieldicon:'download_category_icon'}|array{fieldid:'category_id'}|array{fieldid:'download_category_id'}|array{fieldname:'category_name'}|array{fieldname:'download_category_name'}|array{newsalt:array{fieldicon:'category_icon'}|array{fieldid:'category_id'}|array{fieldname:'category_name'}|array{query:'category_id !=\'-2\' ORDER BY category_name ASC'}|array{sef:'news/list/category'}|array{table:'news_category'}|array{title:'News Categories'}|array{url:'news.php?list.#'},news:array{fieldicon:'category_icon'}|array{fieldid:'category_id'}|array{fieldname:'category_name'}|array{query:'category_id !=\'-2\' ORDER BY category_name ASC'}|array{sef:'news/list/category'}|array{table:'news_category'}|array{title:'News Categories'}|array{url:'news.php?list.#'}}|array{newsalt:array{sef:'news/list/short'}}|array{newsalt:array{title:'News Categories \x28List\x29'}}|array{newsalt:array{url:'news.php?cat.#'}}|array{query:'category_id !=\'-2\' ORDER BY category_name ASC'}|array{query:'download_category_parent =\'0\' ORDER BY download_category_name ASC'}|array{sef:'news/list/category'}|array{sef:'news/list/short'}|array{table:'download_category'}|array{table:'news_category'}|array{title:'Download Categories'}|array{title:'News Categories \x28List\x29'}|array{title:'News Categories'}|array{url:'download.php?list.#'}|array{url:'news.php?cat.#'}|array{url:'news.php?list.#'}
Open

                $subdiz = ($sublink['fielddiz']) ? $row[($sublink['fielddiz'])] : $par['link_description'];
Severity: Minor
Found in e107_admin/links.php by phan

Argument 2 (key) is array|true but \e107::url() takes string defined at /code/e107_handlers/e107_class.php:4225
Open

                    $suburl = e107::url($sublink['sef'], $row);
Severity: Minor
Found in e107_admin/links.php by phan

Reference to undeclared property \e_admin_ui->current_parent
Open

                $current = $this->getController()->current_parent;
Severity: Minor
Found in e107_admin/links.php by phan

Call to undeclared method \e_admin_ui::getLinkArray
Open

                $cats    = $this->getController()->getLinkArray();
Severity: Critical
Found in e107_admin/links.php by phan

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

if (!getperms("I"))
Severity: Minor
Found in e107_admin/links.php by phan

Assigning null to property but \links_admin_ui->_link_array is array|array[]
Open

            $this->_link_array = null; // reset batch/filters
Severity: Minor
Found in e107_admin/links.php by phan

Call to undeclared method \e_object::loadBatch
Open

                $this->getTreeModel()->setParam('order', 'ORDER BY '.$this->listOrder)->loadBatch();
Severity: Critical
Found in e107_admin/links.php by phan

Invalid offset "result" of array type array{downloads:array{fieldicon:'download_category_icon'}}|array{downloads:array{fieldid:'download_category_id'}}|array{downloads:array{fieldname:'download_category_name'}}|array{downloads:array{query:'download_category_parent =\'0\' ORDER BY download_category_name ASC'}}|array{downloads:array{table:'download_category'}}|array{downloads:array{title:'Download Categories'}}|array{downloads:array{url:'download.php?list.#'}}|array{fieldicon:'category_icon'}|array{fieldicon:'download_category_icon'}|array{fieldid:'category_id'}|array{fieldid:'download_category_id'}|array{fieldname:'category_name'}|array{fieldname:'download_category_name'}|array{newsalt:array{fieldicon:'category_icon'}|array{fieldid:'category_id'}|array{fieldname:'category_name'}|array{query:'category_id !=\'-2\' ORDER BY category_name ASC'}|array{sef:'news/list/category'}|array{table:'news_category'}|array{title:'News Categories'}|array{url:'news.php?list.#'},news:array{fieldicon:'category_icon'}|array{fieldid:'category_id'}|array{fieldname:'category_name'}|array{query:'category_id !=\'-2\' ORDER BY category_name ASC'}|array{sef:'news/list/category'}|array{table:'news_category'}|array{title:'News Categories'}|array{url:'news.php?list.#'}}|array{newsalt:array{sef:'news/list/short'}}|array{newsalt:array{title:'News Categories \x28List\x29'}}|array{newsalt:array{url:'news.php?cat.#'}}|array{query:'category_id !=\'-2\' ORDER BY category_name ASC'}|array{query:'download_category_parent =\'0\' ORDER BY download_category_name ASC'}|array{sef:'news/list/category'}|array{sef:'news/list/short'}|array{table:'download_category'}|array{table:'news_category'}|array{title:'Download Categories'}|array{title:'News Categories \x28List\x29'}|array{title:'News Categories'}|array{url:'download.php?list.#'}|array{url:'news.php?cat.#'}|array{url:'news.php?list.#'}
Open

            foreach ($sublink['result'] as $row)
Severity: Minor
Found in e107_admin/links.php by phan

Argument 3 (row) is null but \e107::url() takes array defined at /code/e107_handlers/e107_class.php:4225
Open

                $curVal = e107::url($owner,$sef, null, $opt);
Severity: Minor
Found in e107_admin/links.php by phan

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

            $optarrayp[$key] = $type['title'];
Severity: Info
Found in e107_admin/links.php by phan

When fetching an array index from a value of type array|true, found an array index of type null, but expected the index to be of the non-nullable type int|string
Open

                $subdiz = ($sublink['fielddiz']) ? $row[($sublink['fielddiz'])] : $par['link_description'];
Severity: Minor
Found in e107_admin/links.php by phan

There are no issues that match your filters.

Category
Status