Showing 58 of 61 total issues
Method formatSeconds
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function formatSeconds(int $seconds): string
{
$days = 0;
$hours = 0;
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($identifierField, $identifierValue, $modelClass, $eventType, $platformId, $syncConfigurations)
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($modelClass, $modelData, $eventType, Platform $sourcePlatform, Platform $targetPlatform, bool $shouldDelete)
Method processSyncEvent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function processSyncEvent($modelClass, array $modelData, string $eventType, Platform $targetPlatform, $sync)
Method syncToSinglePlatform
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function syncToSinglePlatform($modelClass, array $modelData, string $eventType, Platform $sourcePlatform, Platform $targetPlatform)
Method performSync
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function performSync($modelClass, array $modelData, string $eventType, Platform $sourcePlatform, ?Platform $targetPlatform = null)
Avoid too many return
statements within this method. Open
return $this->convertForWindows($sitePath.$public.'/index.php');
Avoid too many return
statements within this method. Open
return $sitePath.$public.'/index.php';
Function encode64
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function encode64($input, $count)
{
$output = '';
$i = 0;
do {
- 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 HashPassword
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function HashPassword($password)
{
$random = '';
if (CRYPT_BLOWFISH === 1 && ! $this->portable_hashes) {
- 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 crypt_private
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function crypt_private($password, $setting)
{
$output = '*0';
if (substr($setting, 0, 2) === $output) {
$output = '*1';
- 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 createOrUpdateModel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function createOrUpdateModel($modelClass, array $modelData, Platform $targetPlatform)
{
$uniqueFields = config('sync.unique_identifier_fields', ['ulid', 'uuid', 'slug', 'name', 'title']);
$uniqueIdentifier = null;
- 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 handle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
try {
if ($this->shouldDelete) {
$this->deleteModel();
- 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 processSyncEvent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function processSyncEvent($modelClass, array $modelData, string $eventType, Platform $targetPlatform, $sync)
{
$this->logDebug('Processing sync event', [
'modelClass' => $modelClass,
'eventType' => $eventType,
- 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 transformCustomFields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function transformCustomFields(array $data): array
{
$this->logDebug('Moox Press: Transform custom fields', [
'data' => $data,
]);
- 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 isWhitelisted
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function isWhitelisted(): bool
{
$ipAddress = request()->ip();
$ipWhiteList = config('press.ip_whitelist');
- 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 index
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function index()
{
$packages = config('core.packages');
$available_models = [];
- 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 isWhitelisted
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function isWhitelisted(): bool
{
$ipAddress = request()->ip();
$ipWhiteList = config('user.ip_whitelist');
- 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"