iranianpep/code-jetter

View on GitHub

Showing 1,173 of 1,173 total issues

File bootstrap.js has 1587 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Bootstrap v3.3.5 (http://getbootstrap.com)
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under the MIT license
 */
Severity: Major
Found in public/scripts/bootstrap.js - About 4 days to fix

    File ValidatorTest.php has 929 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace CodeJetter\tests;
    
    use CodeJetter\core\App;
    Severity: Major
    Found in tests/ValidatorTest.php - About 2 days to fix

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

          public function testPluralToSingular()
          {
              $utility = new StringUtility();
      
              $inputOutputs = [
      Severity: Major
      Found in tests/StringUtilityTest.php and 1 other location - About 2 days to fix
      tests/StringUtilityTest.php on lines 238..356

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

      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 testSingularToPlural()
          {
              $utility = new StringUtility();
      
              $inputOutputs = [
      Severity: Major
      Found in tests/StringUtilityTest.php and 1 other location - About 2 days to fix
      tests/StringUtilityTest.php on lines 358..476

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

      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 batchDeleteMessage()
          {
              $inputs = (new Request('POST'))->getInputs();
      
              /**
      Severity: Major
      Found in components/contact/controllers/ContactController.php and 1 other location - About 1 day to fix
      components/user/controllers/MemberGroupController.php on lines 291..349

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

      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 batchDeleteGroup()
          {
              $inputs = (new Request('POST'))->getInputs();
      
              /**
      Severity: Major
      Found in components/user/controllers/MemberGroupController.php and 1 other location - About 1 day to fix
      components/contact/controllers/ContactController.php on lines 293..351

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

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

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

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

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

      Refactorings

      Further Reading

      Method testSelectQuery has 336 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function testSelectQuery()
          {
              $queryMaker = new \CodeJetter\core\database\QueryMaker('testTable');
      
              $criteria = [
      Severity: Major
      Found in tests/QueryMakerTest.php - About 1 day to fix

        Function validate has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
        Open

            public function validate()
            {
                $output = new Output();
                if ($this->isAlreadyValidated()) {
                    // return the current output is already validated
        Severity: Minor
        Found in core/security/Validator.php - About 1 day 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 where has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
        Open

            private function where(array $criteria)
            {
                if (!empty($criteria)) {
                    $where = ' WHERE ';
        
        
        Severity: Minor
        Found in core/database/QueryMaker.php - About 1 day to fix

        Cognitive Complexity

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

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

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

        Further reading

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

            public function testGetTableAlias()
            {
                $stateMapper = new StateMapper();
        
                $inputOutputs = [
        Severity: Major
        Found in tests/BaseMapperTest.php and 1 other location - About 1 day to fix
        tests/BaseMapperTest.php on lines 148..206

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

        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 testRemoveTablePrefixAndSuffix()
            {
                $stateMapper = new StateMapper();
        
                $inputOutputs = [
        Severity: Major
        Found in tests/BaseMapperTest.php and 1 other location - About 1 day to fix
        tests/BaseMapperTest.php on lines 208..266

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

        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

        File StringUtilityTest.php has 528 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        namespace CodeJetter\tests;
        
        use CodeJetter\core\utility\StringUtility;
        Severity: Major
        Found in tests/StringUtilityTest.php - About 1 day to fix

          File QueryMakerTest.php has 507 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          class QueryMakerTest extends \PHPUnit_Framework_TestCase
          {
              public function testSelectQuery()
          Severity: Major
          Found in tests/QueryMakerTest.php - About 1 day to fix

            File Validator.php has 507 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            namespace CodeJetter\core\security;
            
            use CodeJetter\core\FormHandler;
            Severity: Major
            Found in core/security/Validator.php - About 1 day to fix

              Method testValidatePassword has 176 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function testValidatePassword()
                  {
                      $app = App::getInstance();
                      $app->init('dev');
              
              
              Severity: Major
              Found in tests/ValidatorTest.php - About 7 hrs to fix

                File BaseMapper.php has 450 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                namespace CodeJetter\core;
                
                use CodeJetter\core\database\QueryMaker;
                Severity: Minor
                Found in core/BaseMapper.php - About 6 hrs to fix

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

                      public function profileForm()
                      {
                          $currentUser = (new AdminUser())->getLoggedIn();
                  
                          /**
                  Severity: Major
                  Found in components/user/controllers/AdminUserController.php and 1 other location - About 6 hrs to fix
                  components/user/controllers/MemberUserController.php on lines 617..657

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

                  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 profileForm()
                      {
                          $currentUser = (new MemberUser())->getLoggedIn();
                  
                          /**
                  Severity: Major
                  Found in components/user/controllers/MemberUserController.php and 1 other location - About 6 hrs to fix
                  components/user/controllers/AdminUserController.php on lines 627..667

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

                  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

                  File MemberUserController.php has 434 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  namespace CodeJetter\components\user\controllers;
                  
                  use CodeJetter\components\page\models\Page;
                  Severity: Minor
                  Found in components/user/controllers/MemberUserController.php - About 6 hrs to fix

                    File AdminUserController.php has 433 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    namespace CodeJetter\components\user\controllers;
                    
                    use CodeJetter\components\page\models\Page;
                    Severity: Minor
                    Found in components/user/controllers/AdminUserController.php - About 6 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language