iranianpep/code-jetter

View on GitHub

Showing 251 of 1,173 total issues

Method generateSearchCriteria has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function generateSearchCriteria(array $listHeaders, $query = null, $requestMethod = 'GET')
    {
        if ($query === null) {
            $config = Registry::getConfigClass();
            $queryKey = $config->get('list')['query'];
Severity: Minor
Found in core/utility/MysqlUtility.php - About 1 hr to fix

    Method pushMonologHandler has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function pushMonologHandler(Logger $logger, $handlerKey, $handlerConfig = [])
        {
            $activeHandlers = [];
    
            switch ($handlerKey) {
    Severity: Minor
    Found in core/ErrorHandler.php - About 1 hr to fix

      Function slide has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        Carousel.prototype.slide = function (type, next) {
          var $active   = this.$element.find('.item.active')
          var $next     = next || this.getItemForDirection(type, $active)
          var isCycling = this.interval
          var direction = type == 'next' ? 'left' : 'right'
      Severity: Minor
      Found in public/scripts/bootstrap.js - About 1 hr to fix

        Method testIsAllRequired has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function testIsAllRequired()
            {
                $app = App::getInstance();
                $app->init('dev');
        
        
        Severity: Minor
        Found in tests/ValidatorTest.php - About 1 hr to fix

          Function add has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function add(array $inputs, array $fieldsValues = [], $extraDefinedInputs = [])
              {
                  /**
                   * Start validating common inputs.
                   */
          Severity: Minor
          Found in components/user/mappers/UserMapper.php - About 1 hr 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 validateWhitelist has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              private function validateWhitelist(array $args)
              {
                  $output = new Output();
          
                  if (!isset($args['whitelist']) || !is_array($args['whitelist'])) {
          Severity: Minor
          Found in core/security/Validator.php - About 1 hr 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 getDefinedInputs has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getDefinedInputs($action = null, array $includingInputs = [], array $excludingInputs = [])
              {
                  if ($action === 'batchUpdate') {
                      $idRule = new ValidatorRule('id');
                      $definedInputs['id'] = new DatabaseInput('id', [$idRule]);
          Severity: Minor
          Found in components/user/mappers/UserMapper.php - About 1 hr to fix

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

                public function update(
                    array $criteria,
                    array $inputs,
                    array $fieldsValues,
                    $limit = 0,
            Severity: Minor
            Found in components/user/mappers/MemberGroupMapper.php - About 1 hr to fix

              Method testStringLastReplace has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function testStringLastReplace()
                  {
                      $utility = new StringUtility();
              
                      $inputOutputs = [
              Severity: Minor
              Found in tests/StringUtilityTest.php - About 1 hr to fix

                Method forgetPassword has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function forgetPassword(User $user)
                    {
                        $output = new Output();
                
                        if ($this->isUserActive($user) !== true) {
                Severity: Minor
                Found in components/user/services/UserAuthentication.php - About 1 hr to fix

                  Method testGetFilteredInputs has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function testGetFilteredInputs()
                      {
                          $dummyInput1 = new Input('name');
                          $dummyInput2 = new Input('email');
                  
                  
                  Severity: Minor
                  Found in tests/ValidatorTest.php - About 1 hr to fix

                    Method testRemovePrefix has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function testRemovePrefix()
                        {
                            $utility = new StringUtility();
                    
                            $inputOutputs = [
                    Severity: Minor
                    Found in tests/StringUtilityTest.php - About 1 hr to fix

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

                          public function add(array $inputs, array $fieldsValues = [], $extraDefinedInputs = [])
                          {
                              /**
                               * Start validating.
                               */
                      Severity: Minor
                      Found in components/user/mappers/GroupUserXrefMapper.php - About 1 hr to fix

                        Method testMapRowsToObjects has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function testMapRowsToObjects()
                            {
                                $app = App::getInstance();
                                $app->init();
                        
                        
                        Severity: Minor
                        Found in tests/BaseMapperTest.php - About 1 hr to fix

                          Method regexMatch has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function regexMatch($pattern, $path)
                              {
                                  if (empty($pattern) || empty($path)) {
                                      return false;
                                  }
                          Severity: Minor
                          Found in core/Router.php - About 1 hr to fix

                            Function viewChild has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function viewChild()
                                {
                                    $urlParameters = $this->getURLParameters();
                            
                                    if (empty($urlParameters['id'])) {
                            Severity: Minor
                            Found in components/user/controllers/MemberUserController.php - About 1 hr 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 getStatesCitiesGroupedByStates has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function getStatesCitiesGroupedByStates(
                                    array $criteria = [],
                                    $order = null,
                                    $start = 0,
                                    $limit = 0,
                            Severity: Minor
                            Found in components/geolocation/mappers/StateMapper.php - About 1 hr 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 get has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function get($key, $component = null, $checkInEnvironment = true)
                                {
                                    if ($component !== null) {
                                        $rootNamespace = $this->get('ROOT_NAMESPACE');
                            
                            
                            Severity: Minor
                            Found in core/BaseConfig.php - About 1 hr 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 bindValues has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function bindValues(\PDOStatement $statement, array $criteria, $start = 0, $limit = 0, array $fieldsValues = [])
                                {
                                    // bind criteria values
                                    $this->bindCriteria($statement, $criteria);
                            
                            
                            Severity: Minor
                            Found in core/database/QueryMaker.php - About 1 hr 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 pushMonologHandler has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function pushMonologHandler(Logger $logger, $handlerKey, $handlerConfig = [])
                                {
                                    $activeHandlers = [];
                            
                                    switch ($handlerKey) {
                            Severity: Minor
                            Found in core/ErrorHandler.php - About 1 hr 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