Showing 48 of 51 total issues
Model
has 70 functions (exceeds 20 allowed). Consider refactoring. Open
Open
abstract class Model implements Arrayable, ArrayAccess, CanBeEscapedWhenCastToString, Jsonable, JsonSerializable
{
use ForwardsCalls,
GuardsAttributes,
HasAttributes,
File Model.php
has 561 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Moox\RedisModel;
use ArrayAccess;
File press.php
has 398 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/*
|--------------------------------------------------------------------------
| Moox Configuration
Method useGoogleIcons
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function useGoogleIcons()
{
FilamentIcon::register([
'panels::global-search.field' => 'gmdi-search-o',
'panels::pages.dashboard.actions.filter' => 'gmdi-filter-alt-o',
File core.php
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/*
|--------------------------------------------------------------------------
| Moox Configuration
Method panel
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function panel(Panel $panel): Panel
{
return $panel
->id('press')
->path('press')
WpBasePost
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class WpBasePost extends Model
{
use HasFactory, Mutable;
protected $fillable = [
Method authenticate
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function authenticate(): Redirector|RedirectResponse|LoginResponse|null
{
try {
$this->rateLimit(5);
} catch (TooManyRequestsException $exception) {
Builder
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Builder extends \Illuminate\Database\Eloquent\Builder
{
/**
* @var PhpRedisConnection
*/
Function authenticate
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
public function authenticate(): Redirector|RedirectResponse|LoginResponse|null
{
try {
$this->rateLimit(5);
} catch (TooManyRequestsException $exception) {
- Read upRead up
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 setPolicies
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
public function setPolicies()
{
$packages = $this->getPackageNames();
- Read upRead up
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
WpUser
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class WpUser extends Authenticatable implements FilamentUser
{
use HasFactory, Mutable, Notifiable;
protected $fillable = [
Function updateBackLinkAndLogo
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(function updateBackLinkAndLogo() {
const backLink = document.querySelector(".edit-post-fullscreen-mode-close");
const postType = getQueryParam("post_type");
if (backLink) {
Method table
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function table(Table $table): Table
{
$tabsConfig = Config::get('expiry.expiry.tabs', []);
$query = Expiry::query()->where('notified_to', auth()->id())->where('done_at', null);
Method handle
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle()
{
$this->setProgress(1);
$invitationRequests = Training::where('due_at', '<', now())
Method authenticate
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function authenticate(): Redirector|RedirectResponse|LoginResponse|null
{
try {
$this->rateLimit(5);
} catch (TooManyRequestsException $exception) {
Method resetPassword
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function resetPassword(): ?PasswordResetResponse
{
try {
$this->rateLimit(2);
} catch (TooManyRequestsException $exception) {
Method setUp
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function setUp(): void
{
parent::setUp();
$this
Method request
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function request(): void
{
try {
$this->rateLimit(2);
} catch (TooManyRequestsException $exception) {
Method handleModelEvent
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function handleModelEvent($model, $eventType)
{
if (! $this->currentPlatform) {
$this->logDebug('Moox Sync: Model event ignored - current platform not set', ['model' => get_class($model), 'event' => $eventType]);