iranianpep/code-jetter

View on GitHub

Showing 251 of 1,173 total issues

Method testPluralToSingular has 114 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testPluralToSingular()
    {
        $utility = new StringUtility();

        $inputOutputs = [
Severity: Major
Found in tests/StringUtilityTest.php - About 4 hrs to fix

    Method testSingularToPlural has 114 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function testSingularToPlural()
        {
            $utility = new StringUtility();
    
            $inputOutputs = [
    Severity: Major
    Found in tests/StringUtilityTest.php - About 4 hrs to fix

      Function bindCriteria has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

          private function bindCriteria(\PDOStatement $statement, array $criteria)
          {
              // bind criteria values
              if (!empty($criteria)) {
                  $counter = 0;
      Severity: Minor
      Found in core/database/QueryMaker.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

      Method testGetFieldsValues has 99 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function testGetFieldsValues()
          {
              $utility = new InputUtility();
      
              $requiredRule = new ValidatorRule('required');
      Severity: Major
      Found in tests/InputUtilityTest.php - About 3 hrs to fix

        Function authorizeRoute has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

            public function authorizeRoute($accessRole, $rootNamespace, $component, $controller, $redirect = true)
            {
                $roles = Registry::getConfigClass()->get('roles');
                $redirections = Registry::getConfigClass()->get('redirections');
        
        
        Severity: Minor
        Found in core/Router.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

        File BaseMapperTest.php has 328 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        namespace CodeJetter\tests;
        
        use CodeJetter\components\geolocation\mappers\StateMapper;
        Severity: Minor
        Found in tests/BaseMapperTest.php - About 3 hrs to fix

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

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

          Function getAllLoggedIn has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getAllLoggedIn(array $whiteList = null)
              {
                  if (!isset($_SESSION['loggedIn']) || empty($_SESSION['loggedIn']) || !is_array($_SESSION['loggedIn'])) {
                      return false;
                  }
          Severity: Minor
          Found in components/user/services/UserAuthentication.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

          Function batchBindValues has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

              public function batchBindValues(
                  \PDOStatement $statement,
                  array $criteria,
                  $start = 0,
                  $limit = 0,
          Severity: Minor
          Found in core/database/QueryMaker.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

          File UserMapper.php has 314 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          namespace CodeJetter\components\user\mappers;
          
          use CodeJetter\components\user\models\User;
          Severity: Minor
          Found in components/user/mappers/UserMapper.php - About 3 hrs to fix

            File Routes.Template.php has 313 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            namespace CodeJetter;
            
            class RoutesTemplate
            Severity: Minor
            Found in Routes.Template.php - About 3 hrs to fix

              Method testValidateURL has 87 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Method testValidateMoney has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Method checkURL has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function checkURL($url, array $options = [])
                      {
                          if (empty($url)) {
                              throw new \Exception('URL is empty');
                          }
                  Severity: Major
                  Found in core/utility/HTTPUtility.php - About 3 hrs to fix

                    File script.js has 298 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    $(document).ready(function(){
                        toastr.options = {
                            "closeButton": true,
                            "progressBar": true,
                            "preventDuplicates": true,
                    Severity: Minor
                    Found in public/scripts/script.js - About 3 hrs to fix

                      File MemberUserMapper.php has 297 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      namespace CodeJetter\components\user\mappers;
                      
                      use CodeJetter\components\user\models\MemberUser;
                      Severity: Minor
                      Found in components/user/mappers/MemberUserMapper.php - About 3 hrs to fix

                        Function appendDataObjectToForm has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function appendDataObjectToForm(data, form, whitelist)
                        {
                            if (typeof data != "undefined" && typeof form != "undefined") {
                        
                                var foundDiv = $(form).find('.appended-data');
                        Severity: Minor
                        Found in public/scripts/script.js - 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

                        Function getRouteInfo has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function getRouteInfo($urlPath, $requestMethod)
                            {
                                if (empty($requestMethod)) {
                                    return false;
                                }
                        Severity: Minor
                        Found in core/Router.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

                        File Router.php has 288 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        
                        namespace CodeJetter\core;
                        
                        use CodeJetter\components\page\models\MetaTag;
                        Severity: Minor
                        Found in core/Router.php - About 2 hrs to fix

                          File RouterTest.php has 287 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          
                          namespace CodeJetter\tests;
                          
                          use CodeJetter\core\App;
                          Severity: Minor
                          Found in tests/RouterTest.php - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language