EscolaLMS/model-fields

View on GitHub

Showing 3 of 192 total issues

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

    public function getExtraAttributesValues(Model $model, ?int $visibility = null): array
    {
        if (config('model-fields.enabled')) {
            if (!array_key_exists('id', $model->getAttributes())) {
                return [];
Severity: Minor
Found in src/Services/ModelFieldsService.php - About 1 hr to fix

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

        public function addOrUpdateMetadataField(string $class_type, string $name, string $type, string $default = '', array $rules = null, int $visibility = 1 << 0, array $extra = null): Metadata
    Severity: Major
    Found in src/Services/ModelFieldsService.php - About 50 mins to fix

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

          public function addOrUpdateMetadataField(string $class_type, string $name, string $type, string $default = '', array $rules = null, int $visibility = 1 << 0, array $extra = null): Metadata;
      Severity: Major
      Found in src/Services/Contracts/ModelFieldsServiceContract.php - About 50 mins to fix
        Severity
        Category
        Status
        Source
        Language