MPOS/php-mpos

View on GitHub

Showing 1,089 of 1,089 total issues

Function getString has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function getString($nsKey, $itemKey)
    {
        $this->_prepareCache($nsKey);
        if ($this->hasKey($nsKey, $itemKey)) {
            $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_START);
Severity: Minor
Found in include/lib/swiftmailer/classes/Swift/KeyCache/DiskKeyCache.php - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function __call has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function __call($method, $args)
    {
        foreach ($this->_handlers as $handler) {
            if (in_array(strtolower($method),
                array_map('strtolower', (array) $handler->exposeMixinMethods())
Severity: Minor
Found in include/lib/swiftmailer/classes/Swift/Transport/EsmtpTransport.php - About 45 mins 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

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

Function encodeWords has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function encodeWords(Swift_Mime_Header $header, $input, $usedLength = -1)
    {
        $value = '';

        $tokens = $this->getEncodableWordTokens($input);
Severity: Minor
Found in include/lib/swiftmailer/classes/Swift/Mime/Headers/AbstractHeader.php - About 45 mins 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

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

Function createPhrase has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function createPhrase(Swift_Mime_Header $header, $string, $charset, Swift_Mime_HeaderEncoder $encoder = null, $shorten = false)
    {
        // Treat token as exactly what was given
        $phraseStr = $string;
        // If it's not valid
Severity: Minor
Found in include/lib/swiftmailer/classes/Swift/Mime/Headers/AbstractHeader.php - About 45 mins 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 exportToByteStream has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is)
    {
        if ($this->hasKey($nsKey, $itemKey)) {
            $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_START);
            if ($this->_quotes) {
Severity: Minor
Found in include/lib/swiftmailer/classes/Swift/KeyCache/DiskKeyCache.php - About 45 mins 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

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

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 (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 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 ($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 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 (! $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 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

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

Severity
Category
Status
Source
Language