MPOS/php-mpos

View on GitHub

Showing 1,089 of 1,089 total issues

Method getTransactionSummary has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public function getTransactionSummary($account_id=NULL) {
    if ($data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
    $sql = "
      SELECT
        SUM(t.amount) AS total, t.type AS type
Severity: Minor
Found in include/classes/transaction.class.php - About 1 hr to fix

    Method sendChangeConfigEmail has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      public function sendChangeConfigEmail($strType, $userID) {
        $exists = $this->token->doesTokenExist($strType, $userID);
        if ($exists == 0) {
          $token = $this->token->createToken($strType, $userID);
          $aData['token'] = $token;
    Severity: Minor
    Found in include/classes/user.class.php - About 1 hr to fix

      Method smarty_function_html_options_optoutput has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, &$idx)
      {
          if (!is_array($value)) {
              $_key = smarty_function_escape_special_chars($key);
              $_html_result = '<option value="' . $_key . '"';
      Severity: Minor
      Found in include/smarty/libs/plugins/function.html_options.php - About 1 hr to fix

        Method yy_shift has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function yy_shift($yyNewState, $yyMajor, $yypMinor)
            {
                $this->yyidx++;
                if ($this->yyidx >= self::YYSTACKDEPTH) {
                    $this->yyidx--;
        Severity: Minor
        Found in include/smarty/libs/sysplugins/smarty_internal_templateparser.php - About 1 hr to fix

          Method yy_shift has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function yy_shift($yyNewState, $yyMajor, $yypMinor)
              {
                  $this->yyidx++;
                  if ($this->yyidx >= self::YYSTACKDEPTH) {
                      $this->yyidx--;
          Severity: Minor
          Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 1 hr to fix

            Method listInvalidationKeys has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function listInvalidationKeys($cid, $resource_name = null, $cache_id = null, $compile_id = null, $resource_uid = null)
                {
                    $t = array('IVK#ALL');
                    $_name = $_compile = '#';
                    if ($resource_name) {

              Method bind_param has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                public function bind_param($paramTypes) {
                  if (!is_string($paramTypes)) {
                    return false;
                  } else {
                    $args = func_get_args();
              Severity: Minor
              Found in include/classes/strict.class.php - About 1 hr to fix

                Method getMPQueue has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  public function getMPQueue($limit=250) {
                    $stmt = $this->mysqli->prepare("
                      SELECT
                      a.id,
                      a.username,
                Severity: Minor
                Found in include/classes/transaction.class.php - About 1 hr to fix

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                              case 'readonly':
                                  if (!empty($params['strict'])) {
                                      if (!is_scalar($_val)) {
                                          trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", E_USER_NOTICE);
                                      }
                  Severity: Major
                  Found in include/smarty/libs/plugins/function.html_radios.php and 2 other locations - About 1 hr to fix
                  include/smarty/libs/plugins/function.html_checkboxes.php on lines 122..133
                  include/smarty/libs/plugins/function.html_options.php on lines 97..108

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 104.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                              case 'readonly':
                                  if (!empty($params['strict'])) {
                                      if (!is_scalar($_val)) {
                                          trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", E_USER_NOTICE);
                                      }
                  Severity: Major
                  Found in include/smarty/libs/plugins/function.html_checkboxes.php and 2 other locations - About 1 hr to fix
                  include/smarty/libs/plugins/function.html_options.php on lines 97..108
                  include/smarty/libs/plugins/function.html_radios.php on lines 108..119

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 104.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                              case 'readonly':
                                  if (!empty($params['strict'])) {
                                      if (!is_scalar($_val)) {
                                          trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", E_USER_NOTICE);
                                      }
                  Severity: Major
                  Found in include/smarty/libs/plugins/function.html_options.php and 2 other locations - About 1 hr to fix
                  include/smarty/libs/plugins/function.html_checkboxes.php on lines 122..133
                  include/smarty/libs/plugins/function.html_radios.php on lines 108..119

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 104.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Method smarty_mb_str_replace has 29 lines of code (exceeds 25 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 1 hr to fix

                    Function cookie has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        var config = $.cookie = function (key, value, options) {
                    
                            // Write
                    
                            if (value !== undefined && !$.isFunction(value)) {
                    Severity: Minor
                    Found in public/site_assets/bootstrap/js/jquery.cookie.js - About 1 hr to fix

                      Method smarty_modifier_date_format has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function smarty_modifier_date_format($string, $format=null, $default_date='', $formatter='auto')
                      {
                          if ($format === null) {
                              $format = Smarty::$_DATE_FORMAT;
                          }
                      Severity: Minor
                      Found in include/smarty/libs/plugins/modifier.date_format.php - About 1 hr to fix

                        Method smarty_modifier_capitalize has 29 lines of code (exceeds 25 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 1 hr to fix

                          Method compileTemplateSource has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function compileTemplateSource()
                              {
                                  if (!$this->source->recompiled) {
                                      $this->properties['file_dependency'] = array();
                                      if ($this->source->components) {
                          Severity: Minor
                          Found in include/smarty/libs/sysplugins/smarty_internal_template.php - About 1 hr to fix

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

                                public function compile($args, $compiler)
                                {
                                    // check and get attributes
                                    $_attr = $this->getAttributes($compiler, $args);
                                    $_name = trim($_attr['name'], "\"'");
                            Severity: Minor
                            Found in include/smarty/libs/sysplugins/smarty_internal_compile_block.php - About 1 hr to fix

                              Method __construct has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function __construct($main, $slave = false, $strict = false)
                                  {
                                      if ($strict) {
                                          $this->mysqliW = new mysqli_strict($main['host'],
                                              $main['user'], $main['pass'],
                              Severity: Minor
                              Found in include/classes/mysqlims.class.php - About 1 hr to fix

                                Method getApiType has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  private function getApiType($url) {
                                    if (preg_match('/coinchoose.com/', $url)) {
                                      return 'coinchoose';
                                    } else if (preg_match('/btc-e.nz/', $url)) {
                                      return 'btce';
                                Severity: Minor
                                Found in include/classes/tools.class.php - About 1 hr to fix

                                  Method _doAnchors_reference_callback has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      protected function _doAnchors_reference_callback($matches) {
                                          $whole_match =  $matches[1];
                                          $link_text   =  $matches[2];
                                          $link_id     =& $matches[3];
                                  
                                  
                                  Severity: Minor
                                  Found in include/lib/Michelf/Markdown.php - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language