iranianpep/code-jetter

View on GitHub

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

      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

        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

                  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

                      Method testRegexMatch has 135 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Validator has 40 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Validator
                        {
                            /**
                             * @var array
                             */
                        Severity: Minor
                        Found in core/security/Validator.php - About 5 hrs to fix

                          Method testGetAccessRole has 130 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            File QueryMaker.php has 380 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

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

                              Method testGenerateDropDownList has 126 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function testGenerateDropDownList()
                                  {
                                      $utility = new HtmlUtility();
                              
                                      $ios = [
                              Severity: Major
                              Found in tests/HtmlUtilityTest.php - About 5 hrs to fix

                                Function getFieldsValues has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function getFieldsValues(array $inputs, array $definedInputs, $case, array $columnsWhitelist = [])
                                    {
                                        $fieldsValues = [];
                                        if (!empty($definedInputs)) {
                                            foreach ($definedInputs as $definedInput) {
                                Severity: Minor
                                Found in core/utility/InputUtility.php - About 4 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

                                BaseMapper has 36 functions (exceeds 20 allowed). Consider refactoring.
                                Open

                                abstract class BaseMapper extends Base implements ICrud
                                {
                                    protected $database;
                                    protected $table;
                                    protected $modelName;
                                Severity: Minor
                                Found in core/BaseMapper.php - About 4 hrs to fix

                                  Function update has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function update(
                                          array $criteria,
                                          array $inputs,
                                          array $fieldsValues,
                                          $limit = 0,
                                  Severity: Minor
                                  Found in components/user/mappers/UserMapper.php - About 4 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language