iranianpep/code-jetter

View on GitHub

Showing 251 of 1,173 total issues

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

  Tab.prototype.show = function () {
    var $this    = this.element
    var $ul      = $this.closest('ul:not(.dropdown-menu)')
    var selector = $this.data('target')

Severity: Minor
Found in public/scripts/bootstrap.js - About 1 hr to fix

    Method testRemoveURLProtocol has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Method bindCriteria has 30 lines of code (exceeds 25 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 1 hr to fix

        Method getOneById has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getOneById($id, $excludeArchived = true)
            {
                $output = new Output();
                /*
                 * start validating
        Severity: Minor
        Found in core/BaseMapper.php - About 1 hr to fix

          Method validatePassword has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function validatePassword(array $args)
              {
                  $output = new Output();
                  if (empty($args['toBeCheckedInput'])) {
                      $output->setSuccess(false);
          Severity: Minor
          Found in core/security/Validator.php - About 1 hr to fix

            Method send has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function send($to, $subject, $message)
                {
                    if (empty($to)) {
                        throw new \Exception('Recipient for sending email cannot be empty');
                    }
            Severity: Minor
            Found in core/Mailer.php - About 1 hr to fix

              Method make has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function make(Page $page, array $templates, $masterTemplate = null, $formHandler = null)
                  {
                      // set master template
                      if ($masterTemplate === null) {
                          $this->getMaster()->setTemplateName($this->getConfig()->get('defaultMasterTemplate'));
              Severity: Minor
              Found in core/View.php - About 1 hr to fix

                Function checkPosition has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  Affix.prototype.checkPosition = function () {
                    if (!this.$element.is(':visible')) return
                
                    var height       = this.$element.height()
                    var offset       = this.options.offset
                Severity: Minor
                Found in public/scripts/bootstrap.js - About 1 hr to fix

                  Method login has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function login($key, $value, $password)
                      {
                          // determine which mapper should be called
                          $mapperName = $this->getMapperName();
                  
                  
                  Severity: Minor
                  Found in components/user/models/User.php - About 1 hr to fix

                    Method generateRadioButtons has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function generateRadioButtons($options, $name = null, $checked = null, array $configs = [])
                        {
                            $html = '';
                    
                            $type = 'radio';
                    Severity: Minor
                    Found in core/utility/HtmlUtility.php - About 1 hr to fix

                      Function batchInsertQuery has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function batchInsertQuery(array $fieldsValuesCollection)
                          {
                              if (empty($fieldsValuesCollection)) {
                                  throw new \Exception('fieldsValues cannot be empty in insertQuery function');
                              }
                      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 route has a Cognitive Complexity of 10 (exceeds 5 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 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 addStyleFile has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function addStyleFile($filePath, $orderNumber = null)
                          {
                              if ($orderNumber !== null) {
                                  // validate order number
                                  if (!is_numeric($orderNumber) || $orderNumber < 0) {
                      Severity: Minor
                      Found in core/layout/blocks/BaseBlock.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 logMessage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function logMessage($level, $message, $context = [])
                          {
                              if ($this->getConfigs()['inOperation'] !== true) {
                                  return false;
                              }
                      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 addScriptFile has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function addScriptFile($filePath, $orderNumber = null)
                          {
                              if ($orderNumber !== null) {
                                  // validate order number
                                  if (!is_numeric($orderNumber) || $orderNumber < 0) {
                      Severity: Minor
                      Found in core/layout/blocks/BaseBlock.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 testGetExcludeArchivedCriteria has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Method testGetClassNameFromNamespace has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

                          Method forgotPassword has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function forgotPassword($email)
                              {
                                  /**
                                   * Start validating email.
                                   */
                          Severity: Minor
                          Found in components/user/models/User.php - About 1 hr to fix

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

                                public function resetPassword($email, $resetPasswordToken, $password, $passwordConfirmation)
                                {
                                    /**
                                     * Start validating email & token.
                                     */
                            Severity: Minor
                            Found in components/user/models/User.php - About 1 hr to fix

                              Method validateWhitelist has 27 lines of code (exceeds 25 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
                                Severity
                                Category
                                Status
                                Source
                                Language