e107inc/e107

View on GitHub
e107_admin/language.php

Summary

Maintainability
A
40 mins
Test Coverage
F
4%

Consider simplifying this complex logical expression.
Open

        if(preg_match("#\"(.*?)\".*?\"(.*)\"#",$line,$match) ||
            preg_match("#\'(.*?)\'.*?\"(.*)\"#",$line,$match) ||
            preg_match("#\"(.*?)\".*?\'(.*)\'#",$line,$match) ||
            preg_match("#\'(.*?)\'.*?\'(.*)\'#",$line,$match) ||
            preg_match("#\((.*?)\,.*?\"(.*)\"#",$line,$match) ||
Severity: Major
Found in e107_admin/language.php - About 40 mins to fix

    Call to undeclared method \e_db::db_ResetTableList (Did you mean expr->resetTableList())
    Open

                    $sql->db_ResetTableList();
    Severity: Critical
    Found in e107_admin/language.php by phan

    Call to undeclared method \e_db::db_CopyTable (Did you mean expr->copyTable())
    Open

                            if ($sql->db_CopyTable($value, "lan_".$lang."_".$value, $_POST['drop'], $copdata))
    Severity: Critical
    Found in e107_admin/language.php by phan

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

                    $compare[$scr] = file_get_contents($scr);
    Severity: Info
    Found in e107_admin/language.php by phan

    Assigning array<string lans></string> to property but \language_admin->adminMenu is array<string>|array<string>|array{main/prefs:array{caption:'Preferences',perm:'0'},main/tools:array{caption:'Language-Packs',perm:'L',icon:'fas-tools'}}</string></string>
    Open

                    $this->adminMenu['main/deprecated'] = array('caption'=>LANG_LAN_04, 'perm'=>'0');
    Severity: Minor
    Found in e107_admin/language.php by phan

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

                        $lanfile[$k] = e_LANGUAGEDIR.e_LANGUAGE."/lan_".basename($scr);
    Severity: Info
    Found in e107_admin/language.php by phan

    Argument 3 (omit) is array{0:'languages',1:'\\.png',2:'\\.gif',3:'handlers'} but \e_file::get_files() takes string defined at /code/e107_handlers/file_class.php:245
    Open

            $root = $fl->get_files(e_BASE, '.*?/?.*?\.php', $omit, 0);
    Severity: Minor
    Found in e107_admin/language.php by phan

    Argument 3 (omit) is array{0:'languages',1:'\\.png',2:'\\.gif',3:'handlers'} but \e_file::get_files() takes string defined at /code/e107_handlers/file_class.php:245
    Open

            $shortcodes = $fl->get_files(e_CORE . "shortcodes", '.*?/?.*?\.php', $omit, 1);
    Severity: Minor
    Found in e107_admin/language.php by phan

    Argument 3 (subject) is ?string but \str_replace() takes array|string
    Open

            $lanDefines = str_replace($srch,"",$lanDefines);
    Severity: Minor
    Found in e107_admin/language.php by phan

    Reference to undeclared constant \ADMIN_TRUE_ICON
    Open

                    <td class='text-center'>".( $errFound ? ADMIN_FALSE_ICON : ADMIN_TRUE_ICON )."</td>
    Severity: Minor
    Found in e107_admin/language.php by phan

    Call to undeclared method \e_db::isTable
    Open

                        if ($sql->isTable($del_table, $lang))
    Severity: Critical
    Found in e107_admin/language.php by phan

    Call to undeclared method \e_db::isTable
    Open

                        $selected = ($sql->isTable($table_name,$languageSelected)) ? " checked='checked'" : "";
    Severity: Critical
    Found in e107_admin/language.php by phan

    Reference to undeclared constant \ADMIN_TRUE_ICON
    Open

                            $value = ADMIN_TRUE_ICON;
    Severity: Minor
    Found in e107_admin/language.php by phan

    Assigning array<string></string> to property but \language_ui->prefs is array{sitelanguage:array{title:'Default Site Language',type:'dropdown',data:'str',help:'',writeParms:array{useValues:1}},adminlanguage:array{title:'Admin-Area Interface Language',type:'dropdown',data:'str',help:'',writeParms:array{useValues:1,default:'Default Site Language'}},multilanguage:array{title:'Multi-Language Database Tables',type:'boolean',data:'int',help:''},noLanguageSubs:array{title:'Load language files only for current language',type:'boolean',data:'int',help:'If checked, and a required language cannot be found, there will be an error'},multilanguage_subdomain:array{title:'Use Parked Subdomains with these domains to set site Language:',type:'textarea',data:'str',help:'e.g. The domain fr.mydomain.com would set the language to French.',writeParms:array{rows:3,placeholder:'mydomain.com'}},multilanguage_domain:array{title:'Language by Domain Name',type:'method',data:'str',help:'Domain determines the site\'s language. Enter domain without the \'www.\''},multilanguage_verify_errorsonly:array{title:'Display only errors during verification',type:'boolean',data:'int',help:''}}
    Open

                $this->prefs['adminlanguage']['writeParms']['optArray'] = $this->installedLanguages;
    Severity: Minor
    Found in e107_admin/language.php by phan

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

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

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

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

    Call to undeclared method \e_db::db_ResetTableList (Did you mean expr->resetTableList())
    Open

                    $sql->db_ResetTableList();
    Severity: Critical
    Found in e107_admin/language.php by phan

    Call to undeclared method \e_db::isTable
    Open

                            if ($e_language != $pref['sitelanguage'] && $sql->isTable($tab_name,$e_language))
    Severity: Critical
    Found in e107_admin/language.php by phan

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

                $newline[] = (in_array($ret['define'],$_SESSION['language-tools-unused']) && substr($line,0,2) !='//') ? "// ".$line : $line;
    Severity: Info
    Found in e107_admin/language.php by phan

    Argument 3 (omit) is array{0:'languages',1:'\\.png',2:'\\.gif',3:'handlers'} but \e_file::get_files() takes string defined at /code/e107_handlers/file_class.php:245
    Open

            $templates = $fl->get_files(e_CORE . "templates", '.*?/?.*?\.php', $omit, 0);
    Severity: Minor
    Found in e107_admin/language.php by phan

    Reference to undeclared constant \ADMIN_FALSE_ICON
    Open

                    <td class='text-center'>".( $errFound ? ADMIN_FALSE_ICON : ADMIN_TRUE_ICON )."</td>
    Severity: Minor
    Found in e107_admin/language.php by phan

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

                if (isset($_POST['del_existing']) && $_POST['lang_choices'] && getperms('0'))
    Severity: Minor
    Found in e107_admin/language.php by phan

    Reference to undeclared constant \ADMIN_WARNING_ICON
    Open

                            $value = "<a href='#' title=".LAN_MISSING.">".ADMIN_WARNING_ICON."</a>";
    Severity: Minor
    Found in e107_admin/language.php by phan

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

                $ret['text'] = $mes->render().$text;
    Severity: Info
    Found in e107_admin/language.php by phan

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

                        $lanfile[$k] = e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_".basename($scr);
    Severity: Info
    Found in e107_admin/language.php by phan

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

                    $compare[$scr] = file_get_contents($scr);
    Severity: Info
    Found in e107_admin/language.php by phan

    Reference to undeclared constant \ADMIN_WARNING_ICON
    Open

                        $text .= ADMIN_WARNING_ICON;
    Severity: Minor
    Found in e107_admin/language.php by phan

    Assigning array<string></string> to property but \language_ui->prefs is array{sitelanguage:array{title:'Default Site Language',type:'dropdown',data:'str',help:'',writeParms:array{useValues:1}},adminlanguage:array{title:'Admin-Area Interface Language',type:'dropdown',data:'str',help:'',writeParms:array{useValues:1,default:'Default Site Language'}},multilanguage:array{title:'Multi-Language Database Tables',type:'boolean',data:'int',help:''},noLanguageSubs:array{title:'Load language files only for current language',type:'boolean',data:'int',help:'If checked, and a required language cannot be found, there will be an error'},multilanguage_subdomain:array{title:'Use Parked Subdomains with these domains to set site Language:',type:'textarea',data:'str',help:'e.g. The domain fr.mydomain.com would set the language to French.',writeParms:array{rows:3,placeholder:'mydomain.com'}},multilanguage_domain:array{title:'Language by Domain Name',type:'method',data:'str',help:'Domain determines the site\'s language. Enter domain without the \'www.\''},multilanguage_verify_errorsonly:array{title:'Display only errors during verification',type:'boolean',data:'int',help:''}}
    Open

                $this->prefs['sitelanguage']['writeParms']['optArray'] = $this->installedLanguages;
    Severity: Minor
    Found in e107_admin/language.php by phan

    Call to undeclared method \e_db::isTable
    Open

                        elseif ($sql->isTable($value,$_POST['language']))
    Severity: Critical
    Found in e107_admin/language.php by phan

    Argument 1 (title) is int but \language_ui::addTitle() takes string|true defined at /code/e107_handlers/admin_ui.php:2023
    Open

                $this->addTitle($lan);
    Severity: Minor
    Found in e107_admin/language.php by phan

    Reference to undeclared constant \ADMIN_TRUE_ICON
    Open

                        $value = ADMIN_TRUE_ICON;
    Severity: Minor
    Found in e107_admin/language.php by phan

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

                    $arr[] = $arrt;
    Severity: Info
    Found in e107_admin/language.php by phan

    There are no issues that match your filters.

    Category
    Status