MPOS/php-mpos

View on GitHub

Showing 1,089 of 1,089 total issues

Similar blocks of code found in 10 locations. Consider refactoring.
Open

  } else {
    $newerror = array();
    $newerror['name'] = "Memcache Config";
    $newerror['level'] = 2;
     $newerror['extdesc'] = "Memcache is a service that you run that lets us cache commonly used data and access it quickly. It's highly recommended you <a href='https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide#requirements-1'>install the service and php packages</a> for your distro.";
Severity: Major
Found in include/pages/admin/checks/check_memcache.inc.php and 9 other locations - About 40 mins to fix
include/pages/admin/checks/check_daemon.inc.php on lines 6..54
include/pages/admin/checks/check_daemon.inc.php on lines 18..28
include/pages/admin/checks/check_fees.inc.php on lines 5..15
include/pages/admin/checks/check_memcache.inc.php on lines 5..15
include/pages/admin/checks/check_memcache.inc.php on lines 33..53
include/pages/admin/checks/check_memcache.inc.php on lines 57..67
include/pages/admin/checks/check_permissions.inc.php on lines 6..16
include/pages/admin/checks/check_permissions.inc.php on lines 44..55
include/pages/admin/checks/check_stratum.inc.php on lines 28..38

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 94.

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        /* 53 */ array(1, 28, 30, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ),
include/smarty/libs/sysplugins/smarty_internal_templateparser.php on lines 824..824

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 94.

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        /* 54 */ array(1, 3, 30, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ),
include/smarty/libs/sysplugins/smarty_internal_templateparser.php on lines 823..823

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 94.

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

Similar blocks of code found in 10 locations. Consider refactoring.
Open

    if ($bitcoin->is_testnet() == true) {
      $newerror = array();
      $newerror['name'] = "Coin daemon";
      $newerror['level'] = 3;
      $newerror['extdesc'] = "You may have accidentally mistyped the port, or are running the coin daemon in testnet mode. Check your coin daemon config and MPOS config.";
Severity: Major
Found in include/pages/admin/checks/check_daemon.inc.php and 9 other locations - About 40 mins to fix
include/pages/admin/checks/check_daemon.inc.php on lines 6..54
include/pages/admin/checks/check_fees.inc.php on lines 5..15
include/pages/admin/checks/check_memcache.inc.php on lines 5..15
include/pages/admin/checks/check_memcache.inc.php on lines 33..53
include/pages/admin/checks/check_memcache.inc.php on lines 43..53
include/pages/admin/checks/check_memcache.inc.php on lines 57..67
include/pages/admin/checks/check_permissions.inc.php on lines 6..16
include/pages/admin/checks/check_permissions.inc.php on lines 44..55
include/pages/admin/checks/check_stratum.inc.php on lines 28..38

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 94.

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

Consider simplifying this complex logical expression.
Open

        if ((!$this->caching || $_template->has_nocache_code || $_template->source->recompiled) && !$no_output_filter && (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output']))) {
            $_output = Smarty_Internal_Filter_Handler::runFilter('output', $_output, $_template);
        }
Severity: Major
Found in include/smarty/libs/sysplugins/smarty_internal_templatebase.php - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

                if ((!($this->template->source->recompiled) || $this->forceNocache) && $this->template->caching && !$this->suppressNocacheProcessing &&
                    ($this->nocache || $this->tag_nocache)
                ) {
                    $this->template->has_nocache_code = true;
                    $_output = addcslashes($content, '\'\\');
    Severity: Major
    Found in include/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

              if ($this->mustCompile === null) {
                  $this->mustCompile = (!$this->source->uncompiled && ($this->smarty->force_compile || $this->source->recompiled || $this->compiled->timestamp === false ||
                          ($this->smarty->compile_check && $this->compiled->timestamp < $this->source->timestamp)));
              }
      Severity: Major
      Found in include/smarty/libs/sysplugins/smarty_internal_template.php - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

            if ( @$_SESSION['AUTHENTICATED'] == true &&
                 !$this->isLocked($_SESSION['USERDATA']['id']) &&
                 $this->getUserIp($_SESSION['USERDATA']['id']) == $_SERVER['REMOTE_ADDR'] &&
                 ( ! $this->config['protect_session_state'] ||
                   (
        Severity: Major
        Found in include/classes/user.class.php - About 40 mins to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              public function __construct($data = null, $filename = null, $contentType = null)
              {
                  call_user_func_array(
                      array($this, 'Swift_Mime_Attachment::__construct'),
                      Swift_DependencyContainer::getInstance()
          Severity: Minor
          Found in include/lib/swiftmailer/classes/Swift/Attachment.php and 1 other location - About 40 mins to fix
          include/lib/swiftmailer/classes/Swift/EmbeddedFile.php on lines 29..42

          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 93.

          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 2 locations. Consider refactoring.
          Open

                      foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {
                          $exp_token = $this->parser->yyTokenName[$token];
                          if (isset($this->lex->smarty_token_names[$exp_token])) {
                              // token type from lexer
                              $expect[] = '"' . $this->lex->smarty_token_names[$exp_token] . '"';
          include/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on lines 788..797

          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 93.

          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 2 locations. Consider refactoring.
          Open

                          foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {
                              $exp_token = $this->parser->yyTokenName[$token];
                              if (isset($this->lex->smarty_token_names[$exp_token])) {
                                  // token type from lexer
                                  $expect[] = '"' . $this->lex->smarty_token_names[$exp_token] . '"';
          include/smarty/libs/sysplugins/smarty_internal_config_file_compiler.php on lines 126..135

          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 93.

          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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              public function __construct($data = null, $filename = null, $contentType = null)
              {
                  call_user_func_array(
                      array($this, 'Swift_Mime_EmbeddedFile::__construct'),
                      Swift_DependencyContainer::getInstance()
          Severity: Minor
          Found in include/lib/swiftmailer/classes/Swift/EmbeddedFile.php and 1 other location - About 40 mins to fix
          include/lib/swiftmailer/classes/Swift/Attachment.php on lines 29..42

          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 93.

          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 2 locations. Consider refactoring.
          Open

                  if ($_name == null) {
                      $stack_count = count($compiler->_tag_stack);
                      while (--$stack_count >= 0) {
                          if ($compiler->_tag_stack[$stack_count][0] == 'block') {
                              $_name = trim($compiler->_tag_stack[$stack_count][1][0]['name'], "\"'");
          include/smarty/libs/sysplugins/smarty_internal_compile_block.php on lines 139..147

          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 93.

          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 2 locations. Consider refactoring.
          Open

                  if ($_name == null) {
                      $stack_count = count($compiler->_tag_stack);
                      while (--$stack_count >= 0) {
                          if ($compiler->_tag_stack[$stack_count][0] == 'block') {
                              $_name = trim($compiler->_tag_stack[$stack_count][1][0]['name'], "\"'");
          include/smarty/libs/sysplugins/smarty_internal_compile_block.php on lines 216..224

          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 93.

          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_modifier_truncate has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false)
          Severity: Minor
          Found in include/smarty/libs/plugins/modifier.truncate.php - About 35 mins to fix

            Method register_object has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
            Severity: Minor
            Found in include/smarty/libs/SmartyBC.class.php - About 35 mins to fix

              Method compileAllTemplates has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public static function compileAllTemplates($extension, $force_compile, $time_limit, $max_errors, Smarty $smarty)
              Severity: Minor
              Found in include/smarty/libs/sysplugins/smarty_internal_utility.php - About 35 mins to fix

                Method clear has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_internal_cacheresource_file.php - About 35 mins to fix

                  Method compileAllConfig has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public static function compileAllConfig($extension, $force_compile, $time_limit, $max_errors, Smarty $smarty)
                  Severity: Minor
                  Found in include/smarty/libs/sysplugins/smarty_internal_utility.php - About 35 mins to fix

                    Method mutingErrorHandler has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext)
                    Severity: Minor
                    Found in include/smarty/libs/Smarty.class.php - About 35 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language