iranianpep/code-jetter

View on GitHub

Showing 251 of 1,173 total issues

Method listMembers has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function listMembers()
    {
        // for pagination - for simple router url path is enough, for regex ones base path is needed
        $pager = new Pager($this->getURLParameters(), $this->getBasePath(), $this->getRouteInfo()->getUrl());

Severity: Major
Found in components/user/controllers/AdminUserController.php - About 2 hrs to fix

    Method update has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function update(
            array $criteria,
            array $inputs,
            array $fieldsValues,
            $limit = 0,
    Severity: Major
    Found in components/user/mappers/MemberUserMapper.php - About 2 hrs to fix

      File ErrorHandler.php has 268 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace CodeJetter\core;
      
      use Monolog\Formatter\LineFormatter;
      Severity: Minor
      Found in core/ErrorHandler.php - About 2 hrs to fix

        Method getRouteInfo has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getRouteInfo($urlPath, $requestMethod)
            {
                if (empty($requestMethod)) {
                    return false;
                }
        Severity: Major
        Found in core/Router.php - About 2 hrs to fix

          Method viewChild has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function viewChild()
              {
                  $urlParameters = $this->getURLParameters();
          
                  if (empty($urlParameters['id'])) {
          Severity: Major
          Found in components/user/controllers/MemberUserController.php - About 2 hrs to fix

            View has 22 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class View extends Base
            {
                private $config;
                private $master;
                private $header;
            Severity: Minor
            Found in core/View.php - About 2 hrs to fix

              Method listGroups has 56 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function listGroups()
                  {
                      // for pagination
                      // for simple router url path is enough, for regex ones base path is needed
                      $pager = new Pager($this->getURLParameters(), $this->getBasePath(), $this->getRouteInfo()->getUrl());
              Severity: Major
              Found in components/user/controllers/MemberGroupController.php - About 2 hrs to fix

                Method safeBatchDeleteChild has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function safeBatchDeleteChild()
                    {
                        $inputs = (new Request('POST'))->getInputs();
                
                        /**
                Severity: Major
                Found in components/user/controllers/MemberUserController.php - About 2 hrs to fix

                  QueryMaker has 21 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class QueryMaker
                  {
                      private $tables;
                      private $validComparisonOperators = ['LIKE', 'NOT LIKE', '=', '!=', '<>', '<', '<=', '>', '>=', '<=>', 'IS NOT',
                          'IS', 'IS NOT NULL', 'IS NULL', 'IN', 'NOT IN', ];
                  Severity: Minor
                  Found in core/database/QueryMaker.php - About 2 hrs to fix

                    Method testValidateEmail has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Function show has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        Tooltip.prototype.show = function () {
                          var e = $.Event('show.bs.' + this.type)
                      
                          if (this.hasContent() && this.enabled) {
                            this.$element.trigger(e)
                      Severity: Major
                      Found in public/scripts/bootstrap.js - About 2 hrs to fix

                        Method testGetTableAlias has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function testGetTableAlias()
                            {
                                $stateMapper = new StateMapper();
                        
                                $inputOutputs = [
                        Severity: Major
                        Found in tests/BaseMapperTest.php - About 2 hrs to fix

                          Method testRemoveTablePrefixAndSuffix has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function testRemoveTablePrefixAndSuffix()
                              {
                                  $stateMapper = new StateMapper();
                          
                                  $inputOutputs = [
                          Severity: Major
                          Found in tests/BaseMapperTest.php - About 2 hrs to fix

                            Method testValidateWhiteList has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              Function filter has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function filter(array $array, array $excludingElements, $filterBy = 'key')
                                  {
                                      if (empty($excludingElements)) {
                                          return $array;
                                      }
                              Severity: Minor
                              Found in core/utility/ArrayUtility.php - About 2 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 deleteChildById has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function deleteChildById($childId, $safeDelete = true, MemberUser $userMember = null)
                                  {
                                      if ($userMember === null) {
                                          $userMember = (new MemberUser())->getLoggedIn();
                                      }
                              Severity: Major
                              Found in components/user/mappers/MemberUserMapper.php - About 2 hrs to fix

                                Method viewMember has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function viewMember()
                                    {
                                        $urlParameters = $this->getURLParameters();
                                
                                        if (empty($urlParameters['id'])) {
                                Severity: Major
                                Found in components/user/controllers/AdminUserController.php - About 2 hrs to fix

                                  Method add has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function add(array $inputs, array $fieldsValues = [], $extraDefinedInputs = [])
                                      {
                                          /**
                                           * Start validating common inputs.
                                           */
                                  Severity: Major
                                  Found in components/user/mappers/UserMapper.php - About 2 hrs to fix

                                    Method getOneByEmail has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function getOneByEmail($email, $parentId = null, $status = null, $excludeArchived = true)
                                        {
                                            /*
                                             * start validating
                                             */
                                    Severity: Major
                                    Found in components/user/mappers/MemberUserMapper.php - About 2 hrs to fix

                                      Method testGetClassNameByTableName has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function testGetClassNameByTableName()
                                          {
                                              $stateMapper = new StateMapper();
                                      
                                              $inputOutputs = [
                                      Severity: Major
                                      Found in tests/BaseMapperTest.php - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language