Showing 58 of 61 total issues
Method request
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function request(): void
{
try {
$this->rateLimit(2);
} catch (TooManyRequestsException $exception) {
Method setUp
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function setUp(): void
{
parent::setUp();
$this
Function authenticate
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function authenticate(): Redirector|RedirectResponse|LoginResponse|null
{
if (! $this->isWhitelisted()) {
try {
$this->rateLimit(5);
- 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
Method handleModelEvent
has 39 lines of code (exceeds 25 allowed). Consider refactoring. 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]);
Method sendToWebhook
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function sendToWebhook(Platform $platform, bool $shouldDelete)
{
$webhookPath = config('sync.sync_webhook_url', '/sync-webhook');
$syncToken = config('sync.sync_token');
$webhookUrl = 'https://'.$platform->domain.$webhookPath;
Method addUserDevice
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addUserDevice(Request $request, $user, Agent $agent)
{
$ipAddress = $request->ip();
$userAgent = $request->userAgent();
$user_id = $user->getAuthIdentifier();
Function get_user_id_from_laravel_session
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function get_user_id_from_laravel_session($sessionId)
{
error_log('Attempting to get user ID for session: '.$sessionId);
// Use WordPress database credentials for Laravel connection
- 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
Method boot
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function boot()
{
parent::boot();
static::created(function ($model) {
Method sendWebhook
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function sendWebhook(Platform $platform, Platform $targetPlatform)
{
$webhookPath = config('sync.sync_webhook_url', '/sync-webhook');
$webhookUrl = 'https://'.$targetPlatform->domain.$webhookPath;
$syncToken = config('sync.sync_token');
Function insert
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function insert(array $dataInsert, ?Redis $hasTransaction = null)
{
$inserts = [];
$build = static::query();
$model = $build->getModel();
- 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 fill
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function fill(array $attributes)
{
$totallyGuarded = $this->totallyGuarded();
$fillable = $this->fillableFromArray($attributes);
- 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
Method invokeWebhooks
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function invokeWebhooks(array $data)
{
$webhookPath = config('sync.sync_webhook_url', '/sync-webhook');
$syncToken = config('sync.sync_token');
Method performInsert
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function performInsert(Builder $build)
{
// First we'll need to create a fresh query instance and touch the creation and
// update timestamps on this model, which are maintained by us for developer
// convenience. After, we will just continue saving these model instances.
Method boot
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function boot()
{
parent::boot();
static::created(function ($wpTerm) {
Function handle
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
$this->setProgress(1);
$invitationRequests = Training::where('due_at', '<', now())
- 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 log
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function log($level, $message, array $context = [])
{
$verboseLevel = Config::get('core.logging.verbose_level', 0);
$logInProduction = Config::get('core.logging.log_in_production', false);
- 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 frontControllerPath
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function frontControllerPath(string $sitePath, string $siteName, string $uri): ?string
{
$public = '/public';
$wpslug = '/wp';
- 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 performInsert
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function performInsert(Builder $build)
{
// First we'll need to create a fresh query instance and touch the creation and
// update timestamps on this model, which are maintained by us for developer
// convenience. After, we will just continue saving these model instances.
- 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 frontControllerPath
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function frontControllerPath(string $sitePath, string $siteName, string $uri): ?string
{
$public = '/public';
$wpslug = '/wp';
- 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
Method fill
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fill(array $attributes)
{
$totallyGuarded = $this->totallyGuarded();
$fillable = $this->fillableFromArray($attributes);