e107inc/e107

View on GitHub
e107_admin/lancheck.php

Summary

Maintainability
A
2 hrs
Test Coverage
F
2%

Consider simplifying this complex logical expression.
Open

        if((strpos($eng_line,"[link=")!==FALSE && strpos($trans_line,"[link=")===FALSE) || (strpos($eng_line,"[b]")!==FALSE && strpos($trans_line,"[b]")===FALSE))
        {
            $error[] = $def. ": ".LAN_CHECK_30;
        }
        elseif((strpos($eng_line,"[")!==FALSE && strpos($trans_line,"[")===FALSE) || (strpos($eng_line,"]")!==FALSE && strpos($trans_line, "]")===FALSE))
Severity: Major
Found in e107_admin/lancheck.php - About 1 hr to fix

    Avoid too many return statements within this method.
    Open

                return $ret;
    Severity: Major
    Found in e107_admin/lancheck.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return $ret;
      Severity: Major
      Found in e107_admin/lancheck.php - About 30 mins to fix

        Suspicious array access to float|int
        Open

                        $ret['bom'][$key] = $fname;
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Invalid offset "orig" of array type array{bom:array<string>}|array{tran:mixed,bom:array<string>}|array{}|float|int</string></string>
        Open

                    elseif($trans['tran'][$sk] == $trans['orig'][$sk])
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Argument 11 (returnreceipt) is '' but \sendemail() takes bool|false defined at /code/e107_handlers/mail.php:1498
        Open

                if(!@sendemail($send_to, $subject, $email_message, $to_name, '', '', $newfile, $Cc, $Bcc, $returnpath, $returnreceipt,$inline))
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Call to method __construct from undeclared class \PclZip
        Open

                $archive = new PclZip($newfile);
        Severity: Critical
        Found in e107_admin/lancheck.php by phan

        Expected @param annotation for path to be before the @param annotation for defKeys
        Open

             * @param array $defKeys array of constants to comment out.
        Severity: Info
        Found in e107_admin/lancheck.php by phan

        Reference to undeclared constant \LANG_LAN_EML
        Open

                    $text .= defined('LANG_LAN_EML') ?  "<b>".LANG_LAN_EML."</b>" : "<b>There was a problem sending the language-pack. Please email your verified language pack to:</b>";
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Argument 7 (attachments) is object but \sendemail() takes string defined at /code/e107_handlers/mail.php:1498
        Open

                if(!@sendemail($send_to, $subject, $email_message, $to_name, '', '', $newfile, $Cc, $Bcc, $returnpath, $returnreceipt,$inline))
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Reference to undeclared constant \PCLZIP_OPT_ADD_PATH
        Open

                        $addTag = $archive->add($fileName, PCLZIP_OPT_ADD_PATH, 'e107_languages/'.$language, PCLZIP_OPT_REMOVE_PATH, e_FILE.'public/');
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Suspicious array access to float|int
        Open

                        $ret['bom'][$key] = $fname;
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Call to method add from undeclared class \PclZip
        Open

                        $addTag = $archive->add($fileName, PCLZIP_OPT_ADD_PATH, 'e107_languages/'.$language, PCLZIP_OPT_REMOVE_PATH, e_FILE.'public/');
        Severity: Critical
        Found in e107_admin/lancheck.php by phan

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

                $folder['P'] = e_PLUGIN.$comp_name;
        Severity: Info
        Found in e107_admin/lancheck.php by phan

        Invalid offset "orig" of array type array{bom:array<string>}|array{}|float|int</string>
        Open

                $subkeys = array_keys($trans['orig']);
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Invalid offset "tran" of array type array{bom:array<string>}|array{}|float|int</string>
        Open

                    if(empty($trans['tran'][$sk]) && !empty($trans['orig'][$sk]))
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Saw an @param annotation for filter, but it was not found in the param list of function getFilePaths($path, $language, array|mixed $restrict = null) : array|bool
        Open

             * @param string $filter
        Severity: Info
        Found in e107_admin/lancheck.php by phan

        When fetching an array index from a value of type string, found an array index of type 'language', but expected the index to be of type int
        Open

                    foreach($rawData['language'] as $key => $att)
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Variable $input is undeclared
        Open

                unset($input);
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Suspicious array access to nullable ?array{fname:'English.php'}|?mixed
        Open

                        if($f['path'].$f['fname'] == e_LANGUAGEDIR.$lang."/".$lang."_custom.php")
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Saw unextractable annotation for comment '* @return'
        Open

             * @return
        Severity: Info
        Found in e107_admin/lancheck.php by phan

        Invalid offset "orig" of array type array{bom:array<string>}|array{}|float|int</string>
        Open

                    if(empty($trans['tran'][$sk]) && !empty($trans['orig'][$sk]))
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Invalid offset "orig" of array type array{bom:array<string>}|array{}|float|int</string>
        Open

                    $rowamount = round(strlen($trans['orig'][$sk])/34)+1;
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Reference to undeclared constant \PCLZIP_OPT_REMOVE_PATH
        Open

                if ($archive->create($data,PCLZIP_OPT_REMOVE_PATH,e_BASE) == 0)
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        string passed to foreach instead of array
        Open

                    foreach($rawData['language'] as $key => $att)
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Argument 1 (input) is null but \array_keys() takes array
        Open

                $subkeys = array_keys($trans['orig']);
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Argument 1 (path) is object but \basename() takes string
        Open

                $subject .= basename($newfile);
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        When fetching an array index from a value of type string, found an array index of type '\x40attributes', but expected the index to be of type int
        Open

                            $value = $rawData['@attributes'];
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Argument #1 of this call to \str_replace is typically a literal or constant but isn't, but argument #3 (which is typically a variable) is a literal or constant. The arguments may be in the wrong order.
        Open

                    $text = str_replace($srch, $rpl, LANG_LAN_154);
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        Call to method create from undeclared class \PclZip
        Open

                if ($archive->create($data,PCLZIP_OPT_REMOVE_PATH,e_BASE) == 0)
        Severity: Critical
        Found in e107_admin/lancheck.php by phan

        Call to method errorInfo from undeclared class \PclZip
        Open

                    $ret['message'] = $archive->errorInfo(true);
        Severity: Critical
        Found in e107_admin/lancheck.php by phan

        Reference to undeclared constant \PCLZIP_OPT_REMOVE_PATH
        Open

                        $addTag = $archive->add($fileName, PCLZIP_OPT_ADD_PATH, 'e107_languages/'.$language, PCLZIP_OPT_REMOVE_PATH, e_FILE.'public/');
        Severity: Minor
        Found in e107_admin/lancheck.php by phan

        There are no issues that match your filters.

        Category
        Status