.dev/tests/unit/class_validate_test.Test.php

Summary

Maintainability
F
1 mo
Test Coverage

File class_validate_test.Test.php has 1212 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

require_once __DIR__ . '/yf_unit_tests_setup.php';

class class_validate_test extends yf\tests\wrapper
Severity: Major
Found in .dev/tests/unit/class_validate_test.Test.php - About 3 days to fix

    class_validate_test has 75 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class class_validate_test extends yf\tests\wrapper
    {
        public static function tearDownAfterClass() : void
        {
            common()->USER_ERRORS = [];
    Severity: Major
    Found in .dev/tests/unit/class_validate_test.Test.php - About 1 day to fix

      Method test_cleanup_split_trim has 76 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function test_cleanup_split_trim()
          {
              $rules_raw = [
                  'test1,test2,test3' => 'min_length:2|max_length:12|is_unique:user.login|between:1,10|chars:a,b,c,d|regex:[a-z0-9]+',
              ];
      Severity: Major
      Found in .dev/tests/unit/class_validate_test.Test.php - About 3 hrs to fix

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

            public function test_cleanup_33_2()
            {
                $closure = function ($in) {
                    return module('register')->_login_not_exists($in);
                };
        Severity: Minor
        Found in .dev/tests/unit/class_validate_test.Test.php - About 1 hr to fix

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

              public function test_cleanup_33_1()
              {
                  $closure = function ($in) {
                      return module('register')->_login_not_exists($in);
                  };
          Severity: Minor
          Found in .dev/tests/unit/class_validate_test.Test.php - About 1 hr to fix

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

                public function test_cleanup_32()
                {
                    $closure = function ($in) {
                        return module('register')->_login_not_exists($in);
                    };
            Severity: Minor
            Found in .dev/tests/unit/class_validate_test.Test.php - About 1 hr to fix

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

                  public function test_valid_hostname()
                  {
                      $this->assertTrue(_class('validate')->valid_hostname('yahoo.com'));
                      $this->assertTrue(_class('validate')->valid_hostname('facebook.com'));
                      $this->assertTrue(_class('validate')->valid_hostname('google.to.cc'));
              Severity: Minor
              Found in .dev/tests/unit/class_validate_test.Test.php - About 1 hr to fix

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

                    public function test_cleanup_31()
                    {
                        $closure = function ($in) {
                            return module('register')->_login_not_exists($in);
                        };
                Severity: Minor
                Found in .dev/tests/unit/class_validate_test.Test.php - About 1 hr to fix

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

                      public function test_is_natural_no_zero()
                      {
                          $this->assertFalse(_class('validate')->is_natural_no_zero(''));
                          $this->assertFalse(_class('validate')->is_natural_no_zero(null));
                          $this->assertFalse(_class('validate')->is_natural_no_zero(false));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 1 day to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 546..567

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

                  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 test_is_natural()
                      {
                          $this->assertFalse(_class('validate')->is_natural(''));
                          $this->assertFalse(_class('validate')->is_natural(null));
                          $this->assertFalse(_class('validate')->is_natural(false));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 1 day to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 568..589

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

                  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 test_alpha_numeric_spaces()
                      {
                          $this->assertFalse(_class('validate')->alpha_numeric_spaces(''));
                          $this->assertFalse(_class('validate')->alpha_numeric_spaces(null));
                          $this->assertFalse(_class('validate')->alpha_numeric_spaces(false));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 1 day to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 360..381

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

                  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 test_unicode_alpha()
                      {
                          $this->assertFalse(_class('validate')->unicode_alpha(''));
                          $this->assertFalse(_class('validate')->unicode_alpha(null));
                          $this->assertFalse(_class('validate')->unicode_alpha(false));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 1 day to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 320..341

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

                  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 test_cleanup_33_1()
                      {
                          $closure = function ($in) {
                              return module('register')->_login_not_exists($in);
                          };
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 1 day to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 1185..1221

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

                  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 test_cleanup_33_2()
                      {
                          $closure = function ($in) {
                              return module('register')->_login_not_exists($in);
                          };
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 1 day to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 1148..1184

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

                  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 test_unicode_alpha_dash()
                      {
                          $this->assertFalse(_class('validate')->unicode_alpha_dash(''));
                          $this->assertFalse(_class('validate')->unicode_alpha_dash(null));
                          $this->assertFalse(_class('validate')->unicode_alpha_dash(false));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 1 day to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 412..431

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

                  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 test_unicode_alpha_numeric()
                      {
                          $this->assertFalse(_class('validate')->unicode_alpha_numeric(''));
                          $this->assertFalse(_class('validate')->unicode_alpha_numeric(null));
                          $this->assertFalse(_class('validate')->unicode_alpha_numeric(false));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 1 day to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 456..475

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

                  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 test_alpha_dash()
                      {
                          $this->assertFalse(_class('validate')->alpha_dash(''));
                          $this->assertFalse(_class('validate')->alpha_dash(null));
                          $this->assertFalse(_class('validate')->alpha_dash(false));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 1 day to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 302..319

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

                  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 test_alpha_numeric()
                      {
                          $this->assertFalse(_class('validate')->alpha_numeric(''));
                          $this->assertFalse(_class('validate')->alpha_numeric(null));
                          $this->assertFalse(_class('validate')->alpha_numeric(false));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 1 day to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 342..359

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

                  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 test_valid_email()
                      {
                          $this->assertFalse(_class('validate')->valid_email(''));
                          $this->assertFalse(_class('validate')->valid_email(null));
                          $this->assertFalse(_class('validate')->valid_email(false));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 1 day to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 609..627

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

                  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 test_email()
                      {
                          $this->assertFalse(_class('validate')->email(''));
                          $this->assertFalse(_class('validate')->email(null));
                          $this->assertFalse(_class('validate')->email(false));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 1 day to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 590..608

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

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

                      public function test_greater_than_equal_to()
                      {
                          $this->assertTrue(_class('validate')->greater_than_equal_to('12345'));
                          $this->assertTrue(_class('validate')->greater_than_equal_to('12345', ['param' => '0']));
                          $this->assertFalse(_class('validate')->greater_than_equal_to('4', ['param' => '5']));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 3 other locations - About 7 hrs to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 199..211
                  .dev/tests/unit/class_validate_test.Test.php on lines 212..224
                  .dev/tests/unit/class_validate_test.Test.php on lines 238..250

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

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

                      public function test_less_than_equal_to()
                      {
                          $this->assertFalse(_class('validate')->less_than_equal_to('12345'));
                          $this->assertFalse(_class('validate')->less_than_equal_to('12345', ['param' => '0']));
                          $this->assertTrue(_class('validate')->less_than_equal_to('4', ['param' => '5']));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 3 other locations - About 7 hrs to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 199..211
                  .dev/tests/unit/class_validate_test.Test.php on lines 212..224
                  .dev/tests/unit/class_validate_test.Test.php on lines 225..237

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

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

                      public function test_less_than()
                      {
                          $this->assertFalse(_class('validate')->less_than('12345'));
                          $this->assertFalse(_class('validate')->less_than('12345', ['param' => '0']));
                          $this->assertTrue(_class('validate')->less_than('4', ['param' => '5']));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 3 other locations - About 7 hrs to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 199..211
                  .dev/tests/unit/class_validate_test.Test.php on lines 225..237
                  .dev/tests/unit/class_validate_test.Test.php on lines 238..250

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

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

                      public function test_greater_than()
                      {
                          $this->assertTrue(_class('validate')->greater_than('12345'));
                          $this->assertTrue(_class('validate')->greater_than('12345', ['param' => '0']));
                          $this->assertFalse(_class('validate')->greater_than('4', ['param' => '5']));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 3 other locations - About 7 hrs to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 212..224
                  .dev/tests/unit/class_validate_test.Test.php on lines 225..237
                  .dev/tests/unit/class_validate_test.Test.php on lines 238..250

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

                  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 test_max_length()
                      {
                          $this->assertFalse(_class('validate')->max_length('12345'));
                          $this->assertTrue(_class('validate')->max_length('1234', ['param' => '5']));
                          $this->assertTrue(_class('validate')->max_length('12345', ['param' => '5']));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 2 other locations - About 4 hrs to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 151..161
                  .dev/tests/unit/class_validate_test.Test.php on lines 173..183

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

                  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 test_exact_length()
                      {
                          $this->assertFalse(_class('validate')->exact_length('12345'));
                          $this->assertFalse(_class('validate')->exact_length('1234', ['param' => '5']));
                          $this->assertTrue(_class('validate')->exact_length('12345', ['param' => '5']));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 2 other locations - About 4 hrs to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 151..161
                  .dev/tests/unit/class_validate_test.Test.php on lines 162..172

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

                  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 test_cleanup_26_1()
                      {
                          $closure = function ($in) {
                              return module('register')->_login_not_exists($in);
                          };
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 4 hrs to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 1043..1063

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

                  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 test_cleanup_26_2()
                      {
                          $closure = function ($in) {
                              return module('register')->_login_not_exists($in);
                          };
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 4 hrs to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 1022..1042

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

                  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 test_min_length()
                      {
                          $this->assertFalse(_class('validate')->min_length('12345'));
                          $this->assertFalse(_class('validate')->min_length('1234', ['param' => '5']));
                          $this->assertTrue(_class('validate')->min_length('12345', ['param' => '5']));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 2 other locations - About 4 hrs to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 162..172
                  .dev/tests/unit/class_validate_test.Test.php on lines 173..183

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                          $rules_cleaned = [
                              'name' => [
                                  ['trim', null],
                                  ['required', null],
                                  ['min_length', '2'],
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 3 hrs to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 1095..1113

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                          $rules_cleaned = [
                              'name' => [
                                  ['trim', null],
                                  ['required', null],
                                  ['min_length', '2'],
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 3 hrs to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 1127..1145

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

                  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 test_differs()
                      {
                          $this->assertTrue(_class('validate')->differs('', ['param' => 'my_field']));
                          $_POST['my_field'] = '55';
                          $this->assertTrue(_class('validate')->differs('', ['param' => 'my_field'], ['my_field' => '55']));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 2 hrs to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 128..134

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

                  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 test_matches()
                      {
                          $this->assertFalse(_class('validate')->matches('', ['param' => 'my_field']));
                          $_POST['my_field'] = '55';
                          $this->assertFalse(_class('validate')->matches('', ['param' => 'my_field'], ['my_field' => '55']));
                  Severity: Major
                  Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 2 hrs to fix
                  .dev/tests/unit/class_validate_test.Test.php on lines 135..141

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

                  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