MPOS/php-mpos

View on GitHub

Showing 200 of 1,089 total issues

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

        if ($(this).attr("id") === 'motd') {
            var md5motd = $.md5(document.getElementById('motd').innerHTML);
            $.cookie('motd-box', md5motd, { path: '/' });
        } else if ($(this).attr("id") === 'lastlogin') {
            var md5lastlogin = $.md5(document.getElementById('lastlogin').innerHTML);
Severity: Major
Found in public/site_assets/bootstrap/js/mpos.js and 2 other locations - About 45 mins to fix
public/site_assets/bootstrap/js/mpos.js on lines 79..87
public/site_assets/bootstrap/js/mpos.js on lines 82..87

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

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

        } else if ($(this).attr("id") === 'backend') {
            var md5backend = $.md5(document.getElementById('backend').innerHTML);
            $.cookie('backend-box', md5backend, { path: '/' });
        } else {
            //alert($(this).attr("id"));
Severity: Major
Found in public/site_assets/bootstrap/js/mpos.js and 2 other locations - About 45 mins to fix
public/site_assets/bootstrap/js/mpos.js on lines 76..87
public/site_assets/bootstrap/js/mpos.js on lines 79..87

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

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

        } else if ($(this).attr("id") === 'lastlogin') {
            var md5lastlogin = $.md5(document.getElementById('lastlogin').innerHTML);
            $.cookie('lastlogin-box', md5lastlogin, { path: '/' });
        } else if ($(this).attr("id") === 'backend') {
            var md5backend = $.md5(document.getElementById('backend').innerHTML);
Severity: Major
Found in public/site_assets/bootstrap/js/mpos.js and 2 other locations - About 45 mins to fix
public/site_assets/bootstrap/js/mpos.js on lines 76..87
public/site_assets/bootstrap/js/mpos.js on lines 82..87

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

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

    for ($i = 0; $i < strlen($base58); $i++) {
      $current = (string) strpos(Bitcoin::$base58chars, $base58[$i]);
      $return = (string) bcmul($return, "58", 0);
      $return = (string) bcadd($return, $current, 0);
    }
Severity: Minor
Found in include/classes/bitcoin.class.php and 1 other location - About 45 mins to fix
include/classes/bitcoin.class.php on lines 47..51

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

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

    for ($i = 0; $i < strlen($hex); $i++) {
      $current = (string) strpos(self::$hexchars, $hex[$i]);
      $return = (string) bcmul($return, "16", 0);
      $return = (string) bcadd($return, $current, 0);
    }
Severity: Minor
Found in include/classes/bitcoin.class.php and 1 other location - About 45 mins to fix
include/classes/bitcoin.class.php on lines 84..88

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

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

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

if ($config['mc_antidos'] && !$config['memcache']['enabled']) {
  $newerror = array();
  $newerror['name'] = "Memcache Config";
  $newerror['level'] = 3;
   $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 43..53
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 10 locations. Consider refactoring.
Open

  if (! $fp = @fsockopen($config['gettingstarted']['stratumurl'], $config['gettingstarted']['stratumport'], $errCode, $errStr, 1)) {
    $newerror = array();
    $newerror['name'] = "Stratum information";
    $newerror['level'] = 1;
    $newerror['extdesc'] = "We tried to connect the stratum server that you set in your gettingstarted config, but an error occured somewhere along the way. Your stratum server may not be running currently, your firewall could be blocking the connection, or your coin daemon may not yet be fully synced, etc.";
Severity: Major
Found in include/pages/admin/checks/check_stratum.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 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

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

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

  if ($bitcoin->can_connect() !== true) {
    $newerror = array();
    $newerror['name'] = "Coin daemon";
    $newerror['level'] = 3;
    $newerror['description'] = "Unable to connect to coin daemon using provided credentials.";
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 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 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

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

  if (class_exists('Memcached') && $memcache_test_get == $randmctv) {
    $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 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

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

  public function getPreviousBlock($iHeight=0) {
    $stmt = $this->mysqli->prepare("
      SELECT height
      FROM " . $this->block->getTableName() . "
      WHERE height < ?
Severity: Major
Found in include/classes/roundstats.class.php and 2 other locations - About 40 mins to fix
include/classes/roundstats.class.php on lines 8..18
include/classes/roundstats.class.php on lines 38..48

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 (!is_writable($config['logging']['path'])) {
    $newerror = array();
    $newerror['name'] = "Log path permissions";
    $newerror['level'] = 3;
    $newerror['extdesc'] = "In order to log data, we need to be able to write in the logs folder. See the link above for more details.";
Severity: Major
Found in include/pages/admin/checks/check_permissions.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 43..53
include/pages/admin/checks/check_memcache.inc.php on lines 57..67
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 10 locations. Consider refactoring.
Open

if (is_writable(INCLUDE_DIR.'/config/global.inc.php') || is_writable(INCLUDE_DIR.'/config/global.inc.dist.php') ||
  is_writable(INCLUDE_DIR.'/config/security.inc.php') || is_writable(INCLUDE_DIR.'/config/security.inc.dist.php')) {
  $newerror = array();
  $newerror['name'] = "Config permissions";
  $newerror['level'] = 2;
Severity: Major
Found in include/pages/admin/checks/check_permissions.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 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_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 3 locations. Consider refactoring.
Open

  public function getNextBlock($iHeight=0) {
    $stmt = $this->mysqli->prepare("
      SELECT height
      FROM " . $this->block->getTableName() . "
      WHERE height > ?
Severity: Major
Found in include/classes/roundstats.class.php and 2 other locations - About 40 mins to fix
include/classes/roundstats.class.php on lines 23..33
include/classes/roundstats.class.php on lines 38..48

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 (!class_exists('Memcached') && $config['memcache']['enabled']) {
  $newerror = array();
  $newerror['name'] = "Memcache Config";
  $newerror['level'] = 3;
  $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 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

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

if ($config['fees'] == 0 && ($config['txfee_auto'] == 0 || $config['txfee_manual'] == 0)) {
  $newerror = array();
  $newerror['name'] = "Fees and TX Fees 0";
  $newerror['level'] = 2;
  $newerror['extdesc'] = "This is an issue that can only occur with both your fees set to 0 and auto or manual tx fees set to 0 as well. It's best to avoid it if possible though, as it can prevent payouts; set the txfee to a small amount to avoid this.";
Severity: Major
Found in include/pages/admin/checks/check_fees.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_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

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

  public function searchForBlockHeight($iHeight=0) {
    $stmt = $this->mysqli->prepare("
       SELECT height 
       FROM " . $this->block->getTableName() . "
       WHERE height >= ?
Severity: Major
Found in include/classes/roundstats.class.php and 2 other locations - About 40 mins to fix
include/classes/roundstats.class.php on lines 8..18
include/classes/roundstats.class.php on lines 23..33

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

Severity
Category
Status
Source
Language