rinvex/laravel-repositories

View on GitHub

Showing 7 of 38 total issues

EloquentRepository has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

class EloquentRepository extends BaseRepository
{
/**
* {@inheritdoc}
*/
Severity: Minor
Found in src/Repositories/EloquentRepository.php - About 3 hrs to fix

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

abstract class BaseRepository implements RepositoryContract, CacheableContract
{
use Cacheable;
 
/**
Severity: Minor
Found in src/Repositories/BaseRepository.php - About 3 hrs to fix

Method prepareQuery has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

protected function prepareQuery($model)
{
// Set the relationships that should be eager loaded
if (! empty($this->relations)) {
$model = $model->with($this->relations);
Severity: Minor
Found in src/Repositories/BaseRepository.php - About 1 hr to fix

Function prepareQuery has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

protected function prepareQuery($model)
{
// Set the relationships that should be eager loaded
if (! empty($this->relations)) {
$model = $model->with($this->relations);
Severity: Minor
Found in src/Repositories/BaseRepository.php - About 1 hr to fix

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

public function update($id, array $attributes = [], bool $syncRelations = false)
{
$updated = false;
 
// Find the given instance
Severity: Minor
Found in src/Repositories/EloquentRepository.php - About 45 mins to fix

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

protected function bindRepository($abstract, $concrete = null, $shared = true, $alias = null, $force = false): void
Severity: Minor
Found in src/Traits/Bindable.php - About 35 mins to fix

Function forgetCache has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

public function forgetCache()
{
if ($this->getCacheLifetime()) {
// Flush cache tags
if (method_exists($this->getContainer('cache')->getStore(), 'tags')) {
Severity: Minor
Found in src/Traits/Cacheable.php - About 35 mins to fix
Severity
Category
Status
Source
Language