The class BaseRepository has an overall complexity of 58 which is very high. The configured complexity threshold is 50.
abstract class BaseRepository implements RepositoryContract, CacheableContract
{
use Cacheable;
/**
BaseRepository
has 26 functions (exceeds 20 allowed). Consider refactoring.
abstract class BaseRepository implements RepositoryContract, CacheableContract
{
use Cacheable;
/**
Method prepareQuery
has 45 lines of code (exceeds 25 allowed). Consider refactoring.
protected function prepareQuery($model)
{
if (! empty($this->relations)) {
$model = $model->with($this->relations);
Function prepareQuery
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
protected function prepareQuery($model)
{
if (! empty($this->relations)) {
$model = $model->with($this->relations);
The method prepareQuery() has an NPath complexity of 6144. The configured NPath complexity threshold is 200.
protected function prepareQuery($model)
{
if (! empty($this->relations)) {
$model = $model->with($this->relations);
The method prepareQuery() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
protected function prepareQuery($model)
{
if (! empty($this->relations)) {
$model = $model->with($this->relations);
Avoid unused local variables such as '$scope'.
if (method_exists($model = $this->createModel(), $scope = 'scope'.ucfirst($method))) {
Avoid unused local variables such as '$model'.
if (method_exists($model = $this->createModel(), $scope = 'scope'.ucfirst($method))) {
Avoid assigning values to variables in if clauses and the like (line '483', column '58').
public function __call($method, $parameters)
{
if (method_exists($model = $this->createModel(), $scope = 'scope'.ucfirst($method))) {
$this->scope($method, $parameters);
Avoid assigning values to variables in if clauses and the like (line '483', column '27').
public function __call($method, $parameters)
{
if (method_exists($model = $this->createModel(), $scope = 'scope'.ucfirst($method))) {
$this->scope($method, $parameters);
There are no issues that match your filters.