rinvex/cortex-attributes

View on GitHub

Showing 3 of 12 total issues

Method render has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function render(Model $entity, string $accessArea): string
    {
        $default = '';
        $selected = '';

Severity: Minor
Found in src/Models/Attribute.php - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

                    if (mb_strpos($item, '=')) {
                        $details['label'] = mb_strstr($item, '=', true);
                        $item = Str::replaceFirst('=', '', mb_strstr($item, '='));

                        // Check for SELECTED itmes (marked by asterisk)
Severity: Major
Found in src/Models/Attribute.php - About 1 hr to fix

Avoid too many return statements within this method.
Open

                return view("cortex/attributes::{$accessArea}.types.".$this->type, ['attribute' => $this, 'entity' => $entity, 'default' => $default])->render();
Severity: Major
Found in src/Models/Attribute.php - About 30 mins to fix
Severity
Category
Status
Source
Language