AliHichem/AliDatatableBundle

View on GitHub

Showing 30 of 66 total issues

Function hide has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  Collapse.prototype.hide = function () {
    if (this.transitioning || !this.$element.hasClass('in')) return

    var startEvent = $.Event('hide.bs.collapse')
    this.$element.trigger(startEvent)
Severity: Minor
Found in Resources/public/third-party/bootstrap/js/bootstrap.js - About 1 hr to fix

    Function refresh has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      ScrollSpy.prototype.refresh = function () {
        var that          = this
        var offsetMethod  = 'offset'
        var offsetBase    = 0
    
    
    Severity: Minor
    Found in Resources/public/third-party/bootstrap/js/bootstrap.js - About 1 hr to fix

      Function applyTo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function applyTo(array &$data, array $objects)
          {
              foreach ($data as $row_index => $row)
              {
                  $identifier_raw = $data[$row_index][$this->_identifier_index];
      Severity: Minor
      Found in Util/Formatter/Renderer.php - About 35 mins 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 _addSearch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function _addSearch(\Doctrine\ORM\QueryBuilder $queryBuilder)
          {
              if ($this->search == TRUE)
              {
                  $request       = $this->request;
      Severity: Minor
      Found in Util/Factory/Query/DoctrineBuilder.php - About 35 mins 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

      Avoid too many return statements within this function.
      Open

          if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
      Severity: Major
      Found in Resources/public/third-party/bootstrap/js/bootstrap.js - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return $property->getValue($object);
        Severity: Major
        Found in Util/Factory/Query/DoctrineBuilder.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return $__getValue(substr($prop, strpos($prop, '.') + 1), $property->getValue($object));
          Severity: Major
          Found in Util/Factory/Query/DoctrineBuilder.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return array($data, $objects);
            Severity: Major
            Found in Util/Factory/Query/DoctrineBuilder.php - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return false
              Severity: Major
              Found in Resources/public/third-party/bootstrap/js/bootstrap.js - About 30 mins to fix

                Function execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function execute()
                    {
                        $request       = $this->_request;
                        $iTotalRecords = $this->_queryBuilder->getTotalRecords();
                        list($data, $objects) = $this->_queryBuilder->getData();
                Severity: Minor
                Found in Util/Datatable.php - About 25 mins 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