MPOS/php-mpos

View on GitHub

Showing 1,089 of 1,089 total issues

Function md5_cmn has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    function md5_cmn(q, a, b, x, s, t) {
Severity: Minor
Found in public/site_assets/bootstrap/js/jquery.md5.js - About 45 mins to fix

    Method smarty_function_html_options_optoutput has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, &$idx)
    Severity: Minor
    Found in include/smarty/libs/plugins/function.html_options.php - About 45 mins to fix

      Function run_db_upgrade has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function run_db_upgrade($db_version_now) {
        // Dirty, but need it here
        global $setting;
      
        // Drop caches from our settings for live data
      Severity: Minor
      Found in upgrade/run_upgrades.php - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method save has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          abstract protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content);
      Severity: Minor
      Found in include/smarty/libs/sysplugins/smarty_cacheresource_custom.php - About 45 mins to fix

        Function addPluginsDir has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function addPluginsDir($plugins_dir)
            {
                // make sure we're dealing with an array
                $this->plugins_dir = (array) $this->plugins_dir;
        
        
        Severity: Minor
        Found in include/smarty/libs/Smarty.class.php - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function populate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
            {
                $uid = '';
                $sources = array();
                $components = explode('|', $source->name);
        Severity: Minor
        Found in include/smarty/libs/sysplugins/smarty_internal_resource_extends.php - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function smarty_modifiercompiler_wordwrap has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function smarty_modifiercompiler_wordwrap($params, $compiler)
        {
            if (!isset($params[1])) {
                $params[1] = 80;
            }
        Severity: Minor
        Found in include/smarty/libs/plugins/modifiercompiler.wordwrap.php - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function doCompile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function doCompile($_content)
            {
                /* here is where the compiling takes place. Smarty
                  tags in the templates are replaces with PHP code,
                  then written to compiled files. */

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function __construct(Smarty_Resource $handler, Smarty $smarty, $resource, $type, $name, $unique_resource)
        Severity: Minor
        Found in include/smarty/libs/sysplugins/smarty_config_source.php - About 45 mins to fix

          Method fetch has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              abstract protected function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime);
          Severity: Minor
          Found in include/smarty/libs/sysplugins/smarty_cacheresource_custom.php - About 45 mins to fix

            Function append_subtree has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public function append_subtree(_smarty_parsetree $subtree)
                {
                    $last_subtree = count($this->subtrees) - 1;
                    if ($last_subtree >= 0 && $this->subtrees[$last_subtree] instanceof _smarty_tag && $this->subtrees[$last_subtree]->saved_block_nesting < $this->parser->block_nesting_level) {
                        if ($subtree instanceof _smarty_code) {
            Severity: Minor
            Found in include/smarty/libs/sysplugins/smarty_internal_parsetree.php - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Avoid deeply nested control flow statements.
            Open

                                            if ($mod_array[0][$i] != ':') {
                                                $modifierlist[$key][] = $mod_array[0][$i];
                                            }

              Function compileConfigSource has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function compileConfigSource()
                  {
                      // compile template
                      if (!is_object($this->compiler_object)) {
                          // load compiler
              Severity: Minor
              Found in include/smarty/libs/sysplugins/smarty_internal_config.php - About 45 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function __construct(Smarty_Resource $handler, Smarty $smarty, $resource, $type, $name, $unique_resource)
              Severity: Minor
              Found in include/smarty/libs/sysplugins/smarty_resource.php - About 45 mins to fix

                Function offsetSet has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function offsetSet($offset, $value)
                    {
                        if ($offset === null) {
                            if (isset($value[0])) {
                                $x = ($value instanceof TP_yyToken) ?
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_internal_templateparser.php - About 45 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function to_smarty_php has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function to_smarty_php()
                    {
                        $code = '';
                        foreach ($this->subtrees as $subtree) {
                            if ($code !== "") {
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_internal_parsetree.php - About 45 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function mustCompile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function mustCompile()
                    {
                        if (!$this->source->exists) {
                            if ($this->parent instanceof Smarty_Internal_Template) {
                                $parent_resource = " in '$this->parent->template_resource}'";
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_internal_template.php - About 45 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function offsetSet has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function offsetSet($offset, $value)
                    {
                        if ($offset === null) {
                            if (isset($value[0])) {
                                $x = ($value instanceof TPC_yyToken) ?
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 45 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function getWorkers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  public function getWorkers($account_id, $interval=600) {
                    $this->debug->append("STA " . __METHOD__, 4);
                    $stmt = $this->mysqli->prepare("
                      SELECT id, username, password, monitor,
                        (
                Severity: Minor
                Found in include/classes/worker.class.php - About 45 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function getAllWorkers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  public function getAllWorkers($iLimit=0, $interval=600, $start=0) {
                    $this->debug->append("STA " . __METHOD__, 4);
                    $stmt = $this->mysqli->prepare("
                      SELECT id, username, password, monitor,
                        (
                Severity: Minor
                Found in include/classes/worker.class.php - About 45 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Severity
                Category
                Status
                Source
                Language