MPOS/php-mpos

View on GitHub
include/classes/user.class.php

Summary

Maintainability
F
1 wk
Test Coverage

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

<?php
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;

class User extends Base {
  protected $table = 'accounts';
Severity: Major
Found in include/classes/user.class.php - About 1 day to fix

    User has 56 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class User extends Base {
      protected $table = 'accounts';
      private $userID = false;
      private $user = array();
    
    
    Severity: Major
    Found in include/classes/user.class.php - About 1 day to fix

      Function updateAccount has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
      Open

        public function updateAccount($userID, $address, $threshold, $donate, $email, $timezone, $is_anonymous, $strToken) {
          $this->debug->append("STA " . __METHOD__, 4);
          $bUser = false;
          $donate = round($donate, 2);
          // number validation checks
      Severity: Minor
      Found in include/classes/user.class.php - About 7 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function register has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
      Open

        public function register($username, $coinaddress, $password1, $password2, $pin, $email1='', $email2='', $tac='', $strToken='') {
          $this->debug->append("STA " . __METHOD__, 4);
          if ($tac != 1) {
            $this->setErrorMessage('You need to accept our <a href="'.$_SERVER['SCRIPT_NAME'].'?page=tac" target="_blank">Terms and Conditions</a>');
            return false;
      Severity: Minor
      Found in include/classes/user.class.php - About 6 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method register has 118 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        public function register($username, $coinaddress, $password1, $password2, $pin, $email1='', $email2='', $tac='', $strToken='') {
          $this->debug->append("STA " . __METHOD__, 4);
          if ($tac != 1) {
            $this->setErrorMessage('You need to accept our <a href="'.$_SERVER['SCRIPT_NAME'].'?page=tac" target="_blank">Terms and Conditions</a>');
            return false;
      Severity: Major
      Found in include/classes/user.class.php - About 4 hrs to fix

        Function checkLogin has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

          public function checkLogin($username, $password) {
            $this->debug->append("STA " . __METHOD__, 4);
            $this->debug->append("Checking login for $username with password $password", 2);
            if (empty($username) || empty($password)) {
              $this->setErrorMessage("Invalid username or password.");
        Severity: Minor
        Found in include/classes/user.class.php - About 3 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method updateAccount has 80 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public function updateAccount($userID, $address, $threshold, $donate, $email, $timezone, $is_anonymous, $strToken) {
            $this->debug->append("STA " . __METHOD__, 4);
            $bUser = false;
            $donate = round($donate, 2);
            // number validation checks
        Severity: Major
        Found in include/classes/user.class.php - About 3 hrs to fix

          Method checkLogin has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public function checkLogin($username, $password) {
              $this->debug->append("STA " . __METHOD__, 4);
              $this->debug->append("Checking login for $username with password $password", 2);
              if (empty($username) || empty($password)) {
                $this->setErrorMessage("Invalid username or password.");
          Severity: Major
          Found in include/classes/user.class.php - About 2 hrs to fix

            Function getCurrentIP has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

              public function getCurrentIP($trustremote=false, $checkcloudflare=true, $checkclient=false, $checkforwarded=true) {
                $cf = (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) ? $_SERVER['HTTP_CF_CONNECTING_IP'] : false;
                $client = (isset($_SERVER['HTTP_CLIENT_IP'])) ? $_SERVER['HTTP_CLIENT_IP'] : false;
                $fwd = (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : false;
                $remote = (isset($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : @$_SERVER['REMOTE_ADDR'];
            Severity: Minor
            Found in include/classes/user.class.php - About 1 hr 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 updatePassword has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

              public function updatePassword($userID, $current, $new1, $new2, $strToken) {
                $this->debug->append("STA " . __METHOD__, 4);
                if ($new1 !== $new2) {
                  $this->setErrorMessage( 'New passwords do not match' );
                  return false;
            Severity: Minor
            Found in include/classes/user.class.php - About 1 hr 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 resetPassword has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

              public function resetPassword($token, $new1, $new2) {
                $this->debug->append("STA " . __METHOD__, 4);
                if ($aToken = $this->token->getToken($token, 'password_reset')) {
                  if ($new1 !== $new2) {
                    $this->setErrorMessage( 'New passwords do not match' );
            Severity: Minor
            Found in include/classes/user.class.php - About 1 hr 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

            Method updatePassword has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              public function updatePassword($userID, $current, $new1, $new2, $strToken) {
                $this->debug->append("STA " . __METHOD__, 4);
                if ($new1 !== $new2) {
                  $this->setErrorMessage( 'New passwords do not match' );
                  return false;
            Severity: Minor
            Found in include/classes/user.class.php - About 1 hr to fix

              Method initResetPassword has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                public function initResetPassword($username) {
                  $this->debug->append("STA " . __METHOD__, 4);
                  // Fetch the users mail address
                  if (empty($username)) {
                    $this->setErrorMessage("Username must not be empty");
              Severity: Minor
              Found in include/classes/user.class.php - About 1 hr to fix

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

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

                  Method register has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    public function register($username, $coinaddress, $password1, $password2, $pin, $email1='', $email2='', $tac='', $strToken='') {
                  Severity: Major
                  Found in include/classes/user.class.php - About 1 hr to fix

                    Method generatePin has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      public function generatePin($userID, $current) {
                        $this->debug->append("STA " . __METHOD__, 4);
                        $username = $this->getUserName($userID);
                        $email = $this->getUserEmail($username);
                        $strPasswordHash = $this->getUserPasswordHashById($userID);
                    Severity: Minor
                    Found in include/classes/user.class.php - About 1 hr to fix

                      Function initResetPassword has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                        public function initResetPassword($username) {
                          $this->debug->append("STA " . __METHOD__, 4);
                          // Fetch the users mail address
                          if (empty($username)) {
                            $this->setErrorMessage("Username must not be empty");
                      Severity: Minor
                      Found in include/classes/user.class.php - About 1 hr 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

                      Method checkPin has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        public function checkPin($userId, $pin='') {
                          $this->debug->append("STA " . __METHOD__, 4);
                          $this->debug->append("Confirming PIN for $userId and pin $pin", 2);
                          $strPinHash = $this->getUserPinHashById($userId);
                          $aPin = explode('$', $strPinHash);
                      Severity: Minor
                      Found in include/classes/user.class.php - About 1 hr to fix

                        Method resetPassword has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          public function resetPassword($token, $new1, $new2) {
                            $this->debug->append("STA " . __METHOD__, 4);
                            if ($aToken = $this->token->getToken($token, 'password_reset')) {
                              if ($new1 !== $new2) {
                                $this->setErrorMessage( 'New passwords do not match' );
                        Severity: Minor
                        Found in include/classes/user.class.php - About 1 hr to fix

                          Method updateAccount has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            public function updateAccount($userID, $address, $threshold, $donate, $email, $timezone, $is_anonymous, $strToken) {
                          Severity: Major
                          Found in include/classes/user.class.php - About 1 hr to fix

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

                              public function sendChangeConfigEmail($strType, $userID) {
                                $exists = $this->token->doesTokenExist($strType, $userID);
                                if ($exists == 0) {
                                  $token = $this->token->createToken($strType, $userID);
                                  $aData['token'] = $token;
                            Severity: Minor
                            Found in include/classes/user.class.php - About 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 generatePin has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                              public function generatePin($userID, $current) {
                                $this->debug->append("STA " . __METHOD__, 4);
                                $username = $this->getUserName($userID);
                                $email = $this->getUserEmail($username);
                                $strPasswordHash = $this->getUserPasswordHashById($userID);
                            Severity: Minor
                            Found in include/classes/user.class.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

                            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

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

                                public function updatePassword($userID, $current, $new1, $new2, $strToken) {
                              Severity: Minor
                              Found in include/classes/user.class.php - About 35 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                    return false;
                                Severity: Major
                                Found in include/classes/user.class.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                          return true;
                                  Severity: Major
                                  Found in include/classes/user.class.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                          return false;
                                    Severity: Major
                                    Found in include/classes/user.class.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                            return false;
                                      Severity: Major
                                      Found in include/classes/user.class.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                return false;
                                        Severity: Major
                                        Found in include/classes/user.class.php - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                  return false;
                                          Severity: Major
                                          Found in include/classes/user.class.php - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                    return false;
                                            Severity: Major
                                            Found in include/classes/user.class.php - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                    return $remote;
                                              Severity: Major
                                              Found in include/classes/user.class.php - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                        return true;
                                                Severity: Major
                                                Found in include/classes/user.class.php - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                            return true;
                                                  Severity: Major
                                                  Found in include/classes/user.class.php - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                        return false;
                                                    Severity: Major
                                                    Found in include/classes/user.class.php - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                          return false;
                                                      Severity: Major
                                                      Found in include/classes/user.class.php - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                  return false;
                                                        Severity: Major
                                                        Found in include/classes/user.class.php - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                              return false;
                                                          Severity: Major
                                                          Found in include/classes/user.class.php - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                  return false;
                                                            Severity: Major
                                                            Found in include/classes/user.class.php - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                    return false;
                                                              Severity: Major
                                                              Found in include/classes/user.class.php - About 30 mins to fix

                                                                Avoid too many return statements within this method.
                                                                Open

                                                                        return true;
                                                                Severity: Major
                                                                Found in include/classes/user.class.php - About 30 mins to fix

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                          return false;
                                                                  Severity: Major
                                                                  Found in include/classes/user.class.php - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                          return false;
                                                                    Severity: Major
                                                                    Found in include/classes/user.class.php - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                            return false;
                                                                      Severity: Major
                                                                      Found in include/classes/user.class.php - About 30 mins to fix

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                return false;
                                                                        Severity: Major
                                                                        Found in include/classes/user.class.php - About 30 mins to fix

                                                                          Avoid too many return statements within this method.
                                                                          Open

                                                                                      return false;
                                                                          Severity: Major
                                                                          Found in include/classes/user.class.php - About 30 mins to fix

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                  return false;
                                                                            Severity: Major
                                                                            Found in include/classes/user.class.php - About 30 mins to fix

                                                                              Avoid too many return statements within this method.
                                                                              Open

                                                                                    return false;
                                                                              Severity: Major
                                                                              Found in include/classes/user.class.php - About 30 mins to fix

                                                                                Avoid too many return statements within this method.
                                                                                Open

                                                                                          return false;
                                                                                Severity: Major
                                                                                Found in include/classes/user.class.php - About 30 mins to fix

                                                                                  Avoid too many return statements within this method.
                                                                                  Open

                                                                                          return false;
                                                                                  Severity: Major
                                                                                  Found in include/classes/user.class.php - About 30 mins to fix

                                                                                    Avoid too many return statements within this method.
                                                                                    Open

                                                                                            return false;
                                                                                    Severity: Major
                                                                                    Found in include/classes/user.class.php - About 30 mins to fix

                                                                                      Avoid too many return statements within this method.
                                                                                      Open

                                                                                                return true;
                                                                                      Severity: Major
                                                                                      Found in include/classes/user.class.php - About 30 mins to fix

                                                                                        Avoid too many return statements within this method.
                                                                                        Open

                                                                                            return false;
                                                                                        Severity: Major
                                                                                        Found in include/classes/user.class.php - About 30 mins to fix

                                                                                          Avoid too many return statements within this method.
                                                                                          Open

                                                                                                return false;
                                                                                          Severity: Major
                                                                                          Found in include/classes/user.class.php - About 30 mins to fix

                                                                                            Avoid too many return statements within this method.
                                                                                            Open

                                                                                                  return false;
                                                                                            Severity: Major
                                                                                            Found in include/classes/user.class.php - About 30 mins to fix

                                                                                              Avoid too many return statements within this method.
                                                                                              Open

                                                                                                        return true;
                                                                                              Severity: Major
                                                                                              Found in include/classes/user.class.php - About 30 mins to fix

                                                                                                Avoid too many return statements within this method.
                                                                                                Open

                                                                                                        return true;
                                                                                                Severity: Major
                                                                                                Found in include/classes/user.class.php - About 30 mins to fix

                                                                                                  Avoid too many return statements within this method.
                                                                                                  Open

                                                                                                            return false;
                                                                                                  Severity: Major
                                                                                                  Found in include/classes/user.class.php - About 30 mins to fix

                                                                                                    Avoid too many return statements within this method.
                                                                                                    Open

                                                                                                          return false;
                                                                                                    Severity: Major
                                                                                                    Found in include/classes/user.class.php - About 30 mins to fix

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

                                                                                                        public function getLastRegisteredUsers($limit=10,$start=0) {
                                                                                                          $this->debug->append("STA " . __METHOD__, 4);
                                                                                                          $invitation = new Invitation();
                                                                                                          $invitation->setMysql($this->mysqli);
                                                                                                          $invitation->setDebug($this->debug);
                                                                                                      Severity: Major
                                                                                                      Found in include/classes/user.class.php and 1 other location - About 5 hrs to fix
                                                                                                      include/classes/user.class.php on lines 173..191

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

                                                                                                      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 getTopInviters($limit=10,$start=0) {
                                                                                                          $this->debug->append("STA " . __METHOD__, 4);
                                                                                                          $invitation = new Invitation();
                                                                                                          $invitation->setMysql($this->mysqli);
                                                                                                          $invitation->setDebug($this->debug);
                                                                                                      Severity: Major
                                                                                                      Found in include/classes/user.class.php and 1 other location - About 5 hrs to fix
                                                                                                      include/classes/user.class.php on lines 150..166

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

                                                                                                      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

                                                                                                      There are no issues that match your filters.

                                                                                                      Category
                                                                                                      Status