Showing 7 of 38 total issues
EloquentRepository
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class EloquentRepository extends BaseRepository
{
/**
* {@inheritdoc}
*/
- Create a ticketCreate a ticket
BaseRepository
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class BaseRepository implements RepositoryContract, CacheableContract
{
use Cacheable;
/**
- Create a ticketCreate a ticket
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);
- Create a ticketCreate a ticket
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);
- Read upRead up
- Create a ticketCreate a ticket
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
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
- Read upRead up
- Create a ticketCreate a ticket
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 bindRepository
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function bindRepository($abstract, $concrete = null, $shared = true, $alias = null, $force = false): void
- Create a ticketCreate a ticket
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')) {
- Read upRead up
- Create a ticketCreate a ticket
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"