MPOS/php-mpos

View on GitHub

Showing 889 of 1,089 total issues

Function setHeaders has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function setHeaders(Swift_Mime_HeaderSet $headers)
    {
        $bodyLen = $this->_bodyLen;
        if (is_bool($bodyLen)) {
            $bodyLen = - 1;
Severity: Minor
Found in include/lib/swiftmailer/classes/Swift/Signers/OpenDKIMSigner.php - About 2 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 __construct has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($search, $replace)
    {
        $this->_search = $search;
        $this->_index = array();
        $this->_tree = array();

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_modifiercompiler_escape has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function smarty_modifiercompiler_escape($params, $compiler)
{
    static $_double_encode = null;
    if ($_double_encode === null) {
        $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>=');
Severity: Major
Found in include/smarty/libs/plugins/modifiercompiler.escape.php - About 2 hrs to fix

    Method compile has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function compile($args, $compiler)
        {
            $compiler->has_code = true;
            // check and get attributes
            $_attr = $this->getAttributes($compiler, $args);
    Severity: Major
    Found in include/smarty/libs/sysplugins/smarty_internal_compile_block.php - About 2 hrs to fix

      File function.html_select_time.php has 285 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * Smarty plugin
       *
       * @package Smarty
      Severity: Minor
      Found in include/smarty/libs/plugins/function.html_select_time.php - About 2 hrs to fix

        Method compileTemplate has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function compileTemplate(Smarty_Internal_Template $template, $nocache = false)
            {
                if (empty($template->properties['nocache_hash'])) {
                    $template->properties['nocache_hash'] = $this->nocache_hash;
                } else {

          Swift_Signers_DomainKeySigner has 25 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
          {
              /**
               * PrivateKey
               *
          Severity: Minor
          Found in include/lib/swiftmailer/classes/Swift/Signers/DomainKeySigner.php - About 2 hrs to fix

            File share.class.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            $defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
            
            class Share Extends Base {
              protected $table = 'shares';
            Severity: Minor
            Found in include/classes/share.class.php - About 2 hrs to fix

              Method compile has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Method smarty_modifier_debug_print_var has 70 lines of code (exceeds 25 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: Major
                Found in include/smarty/libs/plugins/modifier.debug_print_var.php - About 2 hrs to fix

                  File function.html_select_date.php has 283 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * Smarty plugin
                   *
                   * @package Smarty
                  Severity: Minor
                  Found in include/smarty/libs/plugins/function.html_select_date.php - About 2 hrs to fix

                    Method compile has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function compile($args, $compiler, $parameter)
                        {
                            $_index = preg_split("/\]\[/",substr($parameter, 1, strlen($parameter)-2));
                            $compiled_ref = ' ';
                            $variable = trim($_index[0], "'");

                      Function createTemplate has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true)
                          {
                              if (!empty($cache_id) && (is_object($cache_id) || is_array($cache_id))) {
                                  $parent = $cache_id;
                                  $cache_id = null;
                      Severity: Minor
                      Found in include/smarty/libs/Smarty.class.php - About 2 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_modifier_capitalize has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = false)
                      {
                          if (Smarty::$_MBSTRING) {
                              if ($lc_rest) {
                                  // uppercase (including hyphenated words)
                      Severity: Minor
                      Found in include/smarty/libs/plugins/modifier.capitalize.php - About 2 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 20 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function compile($args, $compiler)
                          {
                              // check and get attributes
                              $_attr = $this->getAttributes($compiler, $args);
                      
                      
                      Severity: Minor
                      Found in include/smarty/libs/sysplugins/smarty_internal_compile_section.php - About 2 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_block_textformat has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function smarty_block_textformat($params, $content, $template, &$repeat)
                      {
                          if (is_null($content)) {
                              return;
                          }
                      Severity: Minor
                      Found in include/smarty/libs/plugins/block.textformat.php - About 2 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_cycle has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function smarty_function_cycle($params, $template)
                      {
                          static $cycle_vars;
                      
                          $name = (empty($params['name'])) ? 'default' : $params['name'];
                      Severity: Minor
                      Found in include/smarty/libs/plugins/function.cycle.php - About 2 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 20 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function compile($args, $compiler, $parameter)
                          {
                              // the following must be assigned at runtime because it will be overwritten in Smarty_Internal_Compile_Append
                              $this->required_attributes = array('var', 'value');
                              $this->shorttag_order = array('var', 'value');
                      Severity: Minor
                      Found in include/smarty/libs/sysplugins/smarty_internal_compile_assign.php - About 2 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 getNotificatorInstance has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                      Open

                              public function getNotificatorInstance($notificator, $data){
                                  $class = null;
                                  $file = null;
                                  
                                  if (is_array($notificator)){
                      Severity: Minor
                      Found in include/classes/pushnotification.class.php - About 2 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 encodeString has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0)
                          {
                              if ($maxLineLength > 76 || $maxLineLength <= 0) {
                                  $maxLineLength = 76;
                              }
                      Severity: Minor
                      Found in include/lib/swiftmailer/classes/Swift/Encoder/QpEncoder.php - About 2 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

                      Severity
                      Category
                      Status
                      Source
                      Language