e107inc/e107

View on GitHub
e107_handlers/bbcode_handler.php

Summary

Maintainability
A
3 hrs
Test Coverage
B
83%

Avoid deeply nested control flow statements.
Open

                                    if (($code_stack[$i]['type'] == 'bbcode') && ($code_stack[$i]['code'] == $bbword) && ($code_stack[0]['numbers'] == $matches[3]))
                                    {
                                        $found = TRUE;
                                        break;
                                    }
Severity: Major
Found in e107_handlers/bbcode_handler.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                        if ($stacktext != '')
                                        { // Stack the text we've accumulated so far
                                            array_unshift($code_stack,array('type' => 'text','code' => $stacktext));
                                            $stacktext = '';
                                        }
    Severity: Major
    Found in e107_handlers/bbcode_handler.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                          while ($i > 0) { $unmatch_stack[] = array_shift($code_stack); $i--; }    // Get required code to top of stack
      Severity: Major
      Found in e107_handlers/bbcode_handler.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                            while (!$found && (count($code_stack) != 0))
                                            {
                                                switch ($code_stack[0]['type'])
                                                {
                                                    case 'text' :
        Severity: Major
        Found in e107_handlers/bbcode_handler.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                              if ($bbword == 'code') $nopro = TRUE;
          Severity: Major
          Found in e107_handlers/bbcode_handler.php - About 45 mins to fix

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

                        $srch[] = $arr[1];    
            Severity: Info
            Found in e107_handlers/bbcode_handler.php by phan

            Invalid offset 0 of array type array{}
            Open

                                                if (($code_stack[$i]['type'] == 'bbcode') && ($code_stack[$i]['code'] == $bbword) && ($code_stack[0]['numbers'] == $matches[3]))
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

            Assigning false[]|string[] to property but \e_bbcode->bbList is array<string>|object[]</string>
            Open

                            $this->bbList[$code] = $bbcode;
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

            Call to undeclared method \e_bb_base::toDB
            Open

                    return $this->toDB($code_text, $parm);
            Severity: Critical
            Found in e107_handlers/bbcode_handler.php by phan

            Call to undeclared method \e_bb_base::toHTML
            Open

                    return $this->toHTML($code_text, $parm);
            Severity: Critical
            Found in e107_handlers/bbcode_handler.php by phan

            Assigning array<string>|array<string></string></string> to property but \e_bbcode->bbList is array<string></string>
            Open

                            $this->bbList[$code] = $bbcode;
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

            Argument 1 (arr) is null but \e_parse::setScriptAttibutes() takes array defined at /code/e107_handlers/e_parse_class.php:3739
            Open

                    $tp->setScriptAttibutes(null);
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

            Call to undeclared method \e_bb_base::toWYSIWYG (Did you mean expr->bbWYSIWYG())
            Open

                    return $this->toWYSIWYG($code_text, $parm);
            Severity: Critical
            Found in e107_handlers/bbcode_handler.php by phan

            Assigning array<string></string> to property but \e_bbcode->bbList is array<string></string>
            Open

                            $this->bbList[$code] = '';
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

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

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

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

                            'trigger'        => vartrue($options['trigger']), // For BC
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

            Invalid offset "-bbcode" of array type array{}
            Open

                    if($this->class && !empty($this->resizePrefs[$this->class.'-bbcode']['h']))
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

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

                    if($this->class && !empty($this->resizePrefs[$this->class.'-bbcode']['h']))
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

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

                        return (int) $this->resizePrefs[$this->class.'-bbcode']['h'];
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

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

                    if($this->class && !empty($this->resizePrefs[$this->class.'-bbcode']['w']))
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

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

                        $ret .= " bbcode-".$type."-".$this->class;
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

            Assigning string[] to property but \e_bbcode->bbList is array<string>|object[]</string>
            Open

                            $this->bbList[$code] = '';
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

            Invalid offset "-bbcode" of array type array{}
            Open

                    if($this->class && !empty($this->resizePrefs[$this->class.'-bbcode']['w']))
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

            Invalid offset "-bbcode" of array type array{}
            Open

                        return (int) $this->resizePrefs[$this->class.'-bbcode']['w'];
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

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

                        return (int) $this->resizePrefs[$this->class.'-bbcode']['w'];
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

            Invalid offset "-bbcode" of array type array{}
            Open

                        return (int) $this->resizePrefs[$this->class.'-bbcode']['h'];
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

            Saw possibly unextractable annotation for a fragment of comment '* @param string (optional) $template eg. news, submitnews, extended, admin, mailout, page, comment, signature': after string, did not see an element name (will guess based on comment order)
            Open

                 * @param string (optional) $template eg. news, submitnews, extended, admin, mailout, page, comment, signature
            Severity: Info
            Found in e107_handlers/bbcode_handler.php by phan

            Assigning 'toDB' to property but \e_bbcode->preProcess is false
            Open

                            $this->preProcess = "toDB";
            Severity: Minor
            Found in e107_handlers/bbcode_handler.php by phan

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

                        $repl[] = $arr[0];
            Severity: Info
            Found in e107_handlers/bbcode_handler.php by phan

            There are no issues that match your filters.

            Category
            Status