MPOS/php-mpos

View on GitHub

Showing 889 of 1,089 total issues

Function compile has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    public function compile($args, $compiler, $parameter)
    {
        // check and get attributes
        $_attr = $this->getAttributes($compiler, $args);

Severity: Minor
Found in include/smarty/libs/sysplugins/smarty_internal_compile_if.php - About 4 hrs 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_function_mailto has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

function smarty_function_mailto($params, $template)
{
    static $_allowed_encoding = array('javascript' => true, 'javascript_charcode' => true, 'hex' => true, 'none' => true);
    $extra = '';

Severity: Minor
Found in include/smarty/libs/plugins/function.mailto.php - About 4 hrs 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 yy_r154 has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    function yy_r154(){
    if (!$this->security || $this->smarty->security_policy->isTrustedPhpFunction($this->yystack[$this->yyidx + -3]->minor, $this->compiler)) {
        if (strcasecmp($this->yystack[$this->yyidx + -3]->minor,'isset') === 0 || strcasecmp($this->yystack[$this->yyidx + -3]->minor,'empty') === 0 || strcasecmp($this->yystack[$this->yyidx + -3]->minor,'array') === 0 || is_callable($this->yystack[$this->yyidx + -3]->minor)) {
            $func_name = strtolower($this->yystack[$this->yyidx + -3]->minor);
            if ($func_name == 'isset') {
Severity: Minor
Found in include/smarty/libs/sysplugins/smarty_internal_templateparser.php - About 4 hrs 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 getnetworkhashps has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

  public function getnetworkhashps() {
    $this->oDebug->append("STA " . __METHOD__, 4);
    if ($data = $this->memcache->get(__FUNCTION__)) return $data;
    try {
      $dNetworkHashrate = $this->getmininginfo();
Severity: Minor
Found in include/classes/bitcoinwrapper.class.php - About 4 hrs 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 smarty_function_html_checkboxes has 100 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function smarty_function_html_checkboxes($params, $template)
{
    require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');

    $name = 'checkbox';
Severity: Major
Found in include/smarty/libs/plugins/function.html_checkboxes.php - About 4 hrs to fix

    Consider simplifying this complex logical expression.
    Open

            if (
                $this->isIOS() && $this->version('iPad', self::VERSION_TYPE_FLOAT)<4.3 ||
                $this->isIOS() && $this->version('iPhone', self::VERSION_TYPE_FLOAT)<3.1 ||
                $this->isIOS() && $this->version('iPod', self::VERSION_TYPE_FLOAT)<3.1 ||
    
    
    Severity: Critical
    Found in include/lib/Mobile_Detect.php - About 4 hrs to fix

      Method smarty_function_html_image has 99 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function smarty_function_html_image($params, $template)
      {
          require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
      
          $alt = '';
      Severity: Major
      Found in include/smarty/libs/plugins/function.html_image.php - About 3 hrs to fix

        Function loadPlugin has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

            public function loadPlugin($plugin_name, $check = true)
            {
                // if function or class exists, exit silently (already loaded)
                if ($check && (is_callable($plugin_name) || class_exists($plugin_name, false))) {
                    return true;
        Severity: Minor
        Found in include/smarty/libs/Smarty.class.php - About 3 hrs 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

        Mobile_Detect has 31 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Mobile_Detect
        {
            /**
             * Mobile detection type.
             *
        Severity: Minor
        Found in include/lib/Mobile_Detect.php - About 3 hrs to fix

          Swift_Transport_AbstractSmtpTransport has 31 functions (exceeds 20 allowed). Consider refactoring.
          Open

          abstract class Swift_Transport_AbstractSmtpTransport implements Swift_Transport
          {
              /** Input-Output buffer for sending/receiving SMTP commands and responses */
              protected $_buffer;
          
          

            File scrypt.php has 325 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
            * Zend Framework (http://framework.zend.com/)
            *
            * @link http://github.com/zendframework/zf2 for the canonical source repository
            Severity: Minor
            Found in include/lib/scrypt.php - About 3 hrs to fix

              Method smarty_function_html_table has 94 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function smarty_function_html_table($params, $template)
              {
                  $table_attr = 'border="1"';
                  $tr_attr = '';
                  $th_attr = '';
              Severity: Major
              Found in include/smarty/libs/plugins/function.html_table.php - About 3 hrs to fix

                Function smarty_modifier_debug_print_var has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40)
                {
                    $_replace = array("\n" => '<i>\n</i>',
                        "\r" => '<i>\r</i>',
                        "\t" => '<i>\t</i>'
                Severity: Minor
                Found in include/smarty/libs/plugins/modifier.debug_print_var.php - About 3 hrs 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 __call has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function __call($name, $args)
                    {
                        static $_prefixes = array('set' => true, 'get' => true);
                        static $_resolved_property_name = array();
                        static $_resolved_property_source = array();
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_internal_templatebase.php - About 3 hrs 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 getPrice has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                  public function getPrice() {
                    $aData = $this->getApi($this->config['price']['url'], $this->config['price']['target']);
                    $strBase = $this->config['currency'];
                    $strQuote = $this->config['price']['currency'];
                    // Check the API type for configured URL
                Severity: Minor
                Found in include/classes/tools.class.php - About 3 hrs 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 compile has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function compile($args, $compiler, $parameter)
                    {
                        // check and get attributes
                        $_attr = $this->getAttributes($compiler, $args);
                        $output = $parameter['value'];

                  Method smarty_function_html_options has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function smarty_function_html_options($params, $template)
                  {
                      require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
                  
                      $name = null;
                  Severity: Major
                  Found in include/smarty/libs/plugins/function.html_options.php - About 3 hrs to fix

                    File AbstractSmtpTransport.php has 318 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    /*
                     * This file is part of SwiftMailer.
                     * (c) 2004-2009 Chris Corbyn

                      Function smarty_mb_str_replace has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                      Open

                          function smarty_mb_str_replace($search, $replace, $subject, &$count=0)
                          {
                              if (!is_array($search) && is_array($replace)) {
                                  return false;
                              }
                      Severity: Minor
                      Found in include/smarty/libs/plugins/shared.mb_str_replace.php - About 3 hrs 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 compile has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function compile($args, $compiler)
                          {
                              if (!($compiler->smarty instanceof SmartyBC)) {
                                  throw new SmartyException("{include_php} is deprecated, use SmartyBC class to enable");
                              }

                      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