GetDKAN/dkan

View on GitHub

Showing 5 of 24 total issues

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

class ComplexDataFacade implements \Iterator, ComplexDataInterface {

  /**
   * Inherited.
   *

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

    class Service implements ContainerInjectionInterface {
      use EventDispatcherTrait;
      use LoggerTrait;
    
      const EVENT_DATA_GET = 'dkan_metastore_data_get';
    Severity: Minor
    Found in modules/metastore/src/Service.php - About 2 hrs to fix

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

        public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, FormBuilder $builder, ValueHandler $value_handler) {
      Severity: Major
      Found in modules/json_form_widget/src/Plugin/Field/FieldWidget/JsonFormWidget.php - About 50 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
          Severity
          Category
          Status
          Source
          Language