GetDKAN/dkan

View on GitHub

Showing 14 of 98 total issues

Data has 25 functions (exceeds 20 allowed). Consider refactoring.
Open

class Data implements MetastoreItemInterface {

  /**
   * Node.
   *
Severity: Minor
Found in modules/metastore/src/NodeWrapper/Data.php - About 2 hrs to fix

    ComplexDataFacade has 24 functions (exceeds 20 allowed). Consider refactoring.
    Open

    abstract class ComplexDataFacade implements \Iterator, ComplexDataInterface {
    
      /**
       * Inherited.
       *

      File DashboardForm.php has 273 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace Drupal\datastore\Form;
      
      use Drupal\Core\Pager\PagerManagerInterface;
      Severity: Minor
      Found in modules/datastore/src/Form/DashboardForm.php - About 2 hrs to fix

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

        abstract class AbstractDatabaseTable implements DatabaseTableInterface {
          use EventDispatcherTrait;
        
          /**
           * The event name we send when we create a table.
        Severity: Minor
        Found in modules/common/src/Storage/AbstractDatabaseTable.php - About 2 hrs to fix

          Data has 22 functions (exceeds 20 allowed). Consider refactoring.
          Open

          abstract class Data implements MetastoreEntityStorageInterface {
          
            /**
             * Entity type manager.
             *
          Severity: Minor
          Found in modules/metastore/src/Storage/Data.php - About 2 hrs to fix

            ResourcePurger has 21 functions (exceeds 20 allowed). Consider refactoring.
            Confirmed

            class ResourcePurger implements ContainerInjectionInterface {
            
              /**
               * The datastore.settings config.
               *
            Severity: Minor
            Found in modules/datastore/src/Service/ResourcePurger.php - About 2 hrs to fix

              Method __construct has 10 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  array $configuration,
                  $plugin_id,
                  $plugin_definition,
                  AlterTableQueryBuilderInterface $alter_table_query_builder,
                  LoggerInterface $logger_channel,

                Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    $plugin_id,
                    $plugin_definition,
                    FieldDefinitionInterface $field_definition,
                    array $settings,
                    array $third_party_settings,

                  Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      array $configuration,
                      $pluginId,
                      $pluginDefinition,
                      LoggerInterface $loggerChannel,
                      MessengerInterface $messenger,

                    Method getFormElement has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      public function getFormElement($type, $definition, $data, $object_schema = NULL, $form_state = NULL, array $context = []) {
                    Severity: Minor
                    Found in modules/json_form_widget/src/FieldTypeRouter.php - About 45 mins to fix

                      Function expandDirectories has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                        private function expandDirectories($base_dir) {
                          $directories = [];
                      
                          if (!file_exists($base_dir)) {
                            return $directories;
                      Severity: Minor
                      Found in modules/frontend/src/Routing/RouteProvider.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

                      Method formElement has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
                      Severity: Minor
                      Found in modules/json_form_widget/src/Plugin/Field/FieldWidget/JsonFormWidget.php - About 35 mins to fix

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

                          public function flattenValues($formValues, $property, $schema) {
                            $data = [];
                        
                            switch ($schema->type) {
                              case 'string':
                        Severity: Minor
                        Found in modules/json_form_widget/src/ValueHandler.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

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

                          private function getObjectInArrayData($formValues, $property, $schema) {
                            $data = [];
                            if (isset($formValues[$property][$property])) {
                              foreach ($formValues[$property][$property] as $key => $item) {
                                $value = $this->handleObjectValues($formValues[$property][$property][$key][$property], $property, $schema);
                        Severity: Minor
                        Found in modules/json_form_widget/src/ValueHandler.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