iranianpep/code-jetter

View on GitHub

Showing 251 of 1,173 total issues

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

      File HtmlUtilityTest.php has 251 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace CodeJetter\tests;
      
      use CodeJetter\core\utility\HtmlUtility;
      Severity: Minor
      Found in tests/HtmlUtilityTest.php - About 2 hrs to fix

        Method testJsonToArray has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Method route has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function route()
              {
                  // get request method and URI
                  $request = new Request();
                  $requestMethod = $request->getRequestMethod();
          Severity: Minor
          Found in core/Router.php - About 2 hrs to fix

            Method authorizeRoute has 50 lines of code (exceeds 25 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 2 hrs to fix

              Method checkTokenIsValidByEmail has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function checkTokenIsValidByEmail($email, $token)
                  {
                      $output = new Output();
              
                      /**
              Severity: Minor
              Found in components/user/models/User.php - About 1 hr to fix

                Method safeBatchDeleteMember has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function safeBatchDeleteMember()
                    {
                        $inputs = (new Request('POST'))->getInputs();
                
                        /**
                Severity: Minor
                Found in components/user/controllers/AdminUserController.php - About 1 hr to fix

                  Method testDiffInFullDays has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function testDiffInFullDays()
                      {
                          $utility = new DateTimeUtility();
                  
                          $ios = [
                  Severity: Minor
                  Found in tests/DateTimeUtilityTest.php - About 1 hr to fix

                    Function update has a Cognitive Complexity of 15 (exceeds 5 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

                    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 isInBlacklist has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function isInBlacklist($errorMessage, $errorFile)
                        {
                            $configs = $this->getConfigs();
                    
                            if ($configs['blacklist']['inOperation'] !== true) {
                    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

                    Function getFilteredInputs has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getFilteredInputs()
                        {
                            if (!isset($this->filteredInputs)) {
                                $this->filteredInputs = [];
                                if (!empty($this->getDefinedInputs())) {
                    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

                    Function generateSearchCriteria has a Cognitive Complexity of 15 (exceeds 5 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

                    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 testGenerateRadioButtons has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function testGenerateRadioButtons()
                        {
                            $utility = new HtmlUtility();
                    
                            $ios = [
                    Severity: Minor
                    Found in tests/HtmlUtilityTest.php - About 1 hr to fix

                      Method getStatesCities has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getStatesCities(
                              array $criteria = [],
                              $fromColumns = null,
                              $order = null,
                              $start = 0,
                      Severity: Minor
                      Found in components/geolocation/mappers/StateMapper.php - About 1 hr to fix

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

                            public function getOneByEmail($email, $parentId = null, $status = null)
                            {
                                /**
                                 * start validating.
                                 */
                        Severity: Minor
                        Found in components/user/mappers/UserMapper.php - About 1 hr to fix

                          Method testFilter has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function testFilter()
                              {
                                  $utility = new ArrayUtility();
                          
                                  $ios = [
                          Severity: Minor
                          Found in tests/ArrayUtilityTest.php - About 1 hr to fix

                            Method safeBatchDeleteGroup has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function safeBatchDeleteGroup()
                                {
                                    $inputs = (new Request('POST'))->getInputs();
                            
                                    /**
                            Severity: Minor
                            Found in components/user/controllers/MemberGroupController.php - About 1 hr to fix

                              Method resetPassword has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function resetPassword(User $user, $token, $password, $passwordConfirmation)
                                  {
                                      $output = new Output();
                                      /**
                                       * Start validating passwords - email & resetPasswordToken are already validated.
                              Severity: Minor
                              Found in components/user/services/UserAuthentication.php - About 1 hr to fix

                                Method testArrayComparison has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function testArrayComparison()
                                    {
                                        $utility = new ArrayUtility();
                                
                                        $ios = [
                                Severity: Minor
                                Found in tests/ArrayUtilityTest.php - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language