Showing 28 of 31 total issues
Function __invoke
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function __invoke(): static
{
$reflection = new \ReflectionClass(static::class);
foreach ($reflection->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
- 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 updateTable
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function updateTable(): void
{
$doubleDown = [];
$sql = "CREATE TABLE `{$this->interimTableName}`(";
foreach ($this->interpreter->filteredProperties() as $i => $property) {
- 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
Request
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Request implements RequestInterface
{
private static ?RequestInterface $instance = null;
public string $requestMethod;
Function initialize
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function initialize(array $staticModel = []): Model
{
foreach ($this->parsedModel as $property) {
- 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 execute
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$modelName = $input->getArgument('model');
$sanitizedModelName = preg_replace('/[\/\\\]/', '_', $modelName);
Method updateTable
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateTable(): void
{
$doubleDown = [];
$sql = "CREATE TABLE `{$this->interimTableName}`(";
foreach ($this->interpreter->filteredProperties() as $i => $property) {
Function removePrivateAttributes
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function removePrivateAttributes(Model &$instance) : void
{
foreach ($this->reflection->properties as $property){
foreach ($property->getAttributes() as $attribute){
if($attribute->newInstance()->getType() === AttributeType::PRIVATE && $property->isPublic() && !$property->isReadOnly()) {
- 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 execute
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$modelName = $input->getArgument('model');
$sanitizedModelName = preg_replace('/[\/\\\]/', '_', $modelName);
- 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 getDependencies
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getDependencies($parameters): array
{
$dependencies = [];
foreach ($parameters as $parameter) {
foreach($this->getParameterTypes($parameter) as $dependency) {
- 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 migrateOne
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function migrateOne($modelName): void
{
if ($this->input->getArgument('dialect') === 'sqlite') {
$migrate = new SqLiteMigration(new ModelInterpreter($modelName), $this->input->getOption('with-copy'));
} else {
Method parseClass
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseClass(): array
{
$this->parsedClass[] = [];
foreach ($this->properties as $i => $property) {
$attributes = $this->propertyMatchList[$property->getName()];
Method __invoke
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __invoke(): static
{
$reflection = new \ReflectionClass(static::class);
foreach ($reflection->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
Function parseClass
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function parseClass(): array
{
$this->parsedClass[] = [];
foreach ($this->properties as $i => $property) {
$attributes = $this->propertyMatchList[$property->getName()];
- 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 migrateOne
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function migrateOne($modelName): void
{
if ($this->input->getArgument('dialect') === 'sqlite') {
$migrate = new SqLiteMigration(new ModelInterpreter($modelName), $this->input->getOption('with-copy'));
} else {
- 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 __construct
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(string $message)
{
Event::dispatch(GenericEvent::UNRECOVERABLE_ERROR,[
self::class => $message
]);
Function __construct
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(string $message)
{
Event::dispatch(GenericEvent::UNRECOVERABLE_ERROR,[
self::class => $message
]);
- 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 initialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function initialize(array $staticModel = []): Model
{
foreach ($this->parsedModel as $property) {
Function convert
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function convert(mixed $data): mixed
{
if ($data instanceof Model || $data instanceof Collection || $data instanceof DataNormalization) {
$data = $data->toArray();
} elseif ($data instanceof Dynamic) {
- 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 directoryExplorer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function directoryExplorer(string $startingPoint, string $nameSpace): void
{
foreach (scandir($startingPoint) as $fileOrFolder) {
if (str_ends_with($fileOrFolder, '.php')) {
try {
- 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 getInstance
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getInstance($mockMe = null, $webPath = ''): ?RequestInterface
{
if ($mockMe) {
self::$instance = $mockMe;
self::$instance->webPath = $webPath;
- 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"