Nayjest/Grids

View on GitHub

Showing 25 of 25 total issues

FieldConfig has 26 functions (exceeds 20 allowed). Consider refactoring.
Open

class FieldConfig
{
    /**
     * Field name.
     *
Severity: Minor
Found in src/FieldConfig.php - About 3 hrs to fix

    ExcelExport has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ExcelExport extends RenderableComponent
    {
        const NAME = 'excel_export';
        const INPUT_PARAM = 'xls';
        const DEFAULT_ROWS_LIMIT = 5000;
    Severity: Minor
    Found in src/Components/ExcelExport.php - About 2 hrs to fix

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

          public function apply()
          {
              $input = $this->grid->getInputProcessor()->getInput();
              $sort = null;
              if (isset($input['sort'])) {
      Severity: Minor
      Found in src/Sorter.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 getDefaultJsOptions has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function getDefaultJsOptions()
          {
              $carbon = new Carbon();
              $prev_month = Carbon::now()->startOfMonth()->subWeek();
              $today = Carbon::now();
      Severity: Minor
      Found in src/Components/Filters/DateRangePicker.php - About 1 hr to fix

        Method makeConfigBlueprint has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function makeConfigBlueprint()
            {
                $component_blueprint = $this->blueprints->getFor(self::COMPONENT_CLASS);
                if (!$component_blueprint) {
                    throw new LogicException(
        Severity: Minor
        Found in src/Build/Setup.php - About 1 hr to fix

          Method listen has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function listen(DataProvider $provider)
              {
                  Event::listen(
                      DataProvider::EVENT_FETCH_ROW,
                      function (DataRow $row, DataProvider $currentProvider) use ($provider) {
          Severity: Minor
          Found in src/Components/TotalsRow.php - About 1 hr to fix

            Method makeComponentBlueprint has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function makeComponentBlueprint()
                {
                    $blueprint = new Blueprint(self::COMPONENT_CLASS, [
            
                        new CustomInstruction(function (Scaffold $s) {
            Severity: Minor
            Found in src/Build/Setup.php - About 1 hr to fix

              Function extractCellValue has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function extractCellValue($fieldName)
                  {
                      if (strpos($fieldName, '.') !== false) {
                          $parts = explode('.', $fieldName);
                          $res = $this->src;
              Severity: Minor
              Found in src/ArrayDataRow.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 apply has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function apply(Scaffold $scaffold)
                  {
                      $src = $scaffold->getInput('src');
                      $scaffold->excludeInput('src');
                      $class = null;
              Severity: Minor
              Found in src/Build/Instructions/BuildDataProvider.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 filter has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function filter($fieldName, $operator, $value)
                  {
                       switch ($operator) {
                          case "eq":
                              $operator = '=';
              Severity: Minor
              Found in src/DbalDataProvider.php - About 1 hr to fix

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

                    public function filter($fieldName, $operator, $value)
                    {
                        switch ($operator) {
                            case "eq":
                                $operator = '=';
                Severity: Minor
                Found in src/EloquentDataProvider.php - About 1 hr to fix

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

                      public function apply()
                      {
                          $input = $this->grid->getInputProcessor()->getInput();
                          $sort = null;
                          if (isset($input['sort'])) {
                  Severity: Minor
                  Found in src/Sorter.php - About 1 hr to fix

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

                        public function apply(Scaffold $scaffold)
                        {
                            $src = $scaffold->getInput('src');
                            $scaffold->excludeInput('src');
                            $class = null;
                    Severity: Minor
                    Found in src/Build/Instructions/BuildDataProvider.php - About 1 hr to fix

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

                          public function filter($fieldName, $operator, $value)
                          {
                               switch ($operator) {
                                  case "eq":
                                      $operator = '=';
                      Severity: Minor
                      Found in src/DbalDataProvider.php - About 55 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 extractCellValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function extractCellValue($fieldName)
                          {
                      
                              if (strpos($fieldName, '.') !== false) {
                                  $parts = explode('.', $fieldName);
                      Severity: Minor
                      Found in src/ObjectDataRow.php - About 55 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 getComponentByNameRecursive has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getComponentByNameRecursive($name)
                          {
                              foreach ($this->getComponents() as $component) {
                                  if ($component->getName() === $name) {
                                      return $component;
                      Severity: Minor
                      Found in src/Components/Base/TRegistry.php - About 55 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 filter has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function filter($fieldName, $operator, $value)
                          {
                              switch ($operator) {
                                  case "eq":
                                      $operator = '=';
                      Severity: Minor
                      Found in src/EloquentDataProvider.php - About 55 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 listen has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function listen(DataProvider $provider)
                          {
                              Event::listen(
                                  DataProvider::EVENT_FETCH_ROW,
                                  function (DataRow $row, DataProvider $currentProvider) use ($provider) {
                      Severity: Minor
                      Found in src/Components/TotalsRow.php - About 45 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 provideName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function provideName()
                          {
                              $bt_len = 10;
                              $backtrace = debug_backtrace(null, $bt_len);
                              $str = '';
                      Severity: Minor
                      Found in src/Grid.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 getColumnsVisibility has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getColumnsVisibility()
                          {
                              $key = $this->getId('cookie');
                              if (isset($_COOKIE[$key])) {
                                  $from_cookie = json_decode($_COOKIE[$key], true);
                      Severity: Minor
                      Found in src/Components/ColumnsHider.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