Showing 60 of 103 total issues
File mimes.php
has 642 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* --------------------------------------------------------------------------
* Mimes
Function asHtml
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function asHtml($config)
{
$class = $config['class'];
$dates = $config['dates'];
- 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 handle
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
$this->filesystem = new Filesystem();
$crudGenerator = new CrudGenerator();
Function menu
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function menu($slug, $view = null, $class = '')
{
$pageRepository = app(PageRepository::class);
$menu = app(MenuRepository::class)->getBySlug($slug);
- 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
File cms.php
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* --------------------------------------------------------------------------
* Grafite CMS Config
Function handle
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
if (is_dir(base_path(Config::get('cms.module-directory')).DIRECTORY_SEPARATOR.ucfirst($this->argument('module')).DIRECTORY_SEPARATOR.'Publishes')) {
$fileSystem = new Filesystem();
- 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 afterCreate
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function afterCreate($payload)
{
if (config('cms.auto-translate', false)) {
$entry = $payload->toArray();
- 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 handle
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
$crudGenerator = new CrudGenerator();
$name = ucfirst(str_singular($this->argument('name')));
Method boot
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function boot()
{
$this->publishes([
__DIR__.'/PublishedAssets/Views/themes' => base_path('resources/themes'),
__DIR__.'/PublishedAssets/Controllers' => app_path('Http/Controllers/Cms'),
Function setSchema
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function setSchema()
{
if ($this->option('schema')) {
$migrationFiles = $this->filesystem->allFiles(base_path('cms/Modules/'.ucfirst(str_plural($this->table)).'/Migrations'));
$migrationName = 'create_'.str_plural(strtolower($this->table)).'_table';
- 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 asHtml
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function asHtml($config)
{
$class = $config['class'];
$dates = $config['dates'];
Method menu
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function menu($slug, $view = null, $class = '')
{
$pageRepository = app(PageRepository::class);
$menu = app(MenuRepository::class)->getBySlug($slug);
Function handle
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
$name = $this->argument('name');
$fileSystem = new Filesystem();
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
$moduleDir = base_path(config('cms.module-directory')).'/'.ucfirst($this->argument('module'));
if (is_dir($moduleDir)) {
$readMeStub = file_get_contents(__DIR__.'/../Templates/Composer/readme.stub');
- 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 saveFile
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function saveFile($fileName, $directory = '', $fileTypes = [], $isImage = false)
{
if (is_object($fileName)) {
$file = $fileName;
$originalName = $file->getClientOriginalName();
Method handle
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
$name = $this->argument('name');
$fileSystem = new Filesystem();
Method handle
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
if (is_dir(base_path(Config::get('cms.module-directory')).DIRECTORY_SEPARATOR.ucfirst($this->argument('module')).DIRECTORY_SEPARATOR.'Publishes')) {
$fileSystem = new Filesystem();
Function menus
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function menus()
{
$modulePath = base_path(config('cms.module-directory').'/');
$modules = glob($modulePath.'*');
- 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 check
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function check($form, $jsonInput = false)
{
$result = [];
$errors = [];
$inputs = [];
Method afterCreate
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function afterCreate($payload)
{
if (config('cms.auto-translate', false)) {
$entry = $payload->toArray();