Showing 132 of 160 total issues
Function getFindData
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function getFindData()
{
$q = request('q');
$id = request('id');
$limit = request('limit') ?: 10;
- 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 getPreview
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function getPreview($one, $two = null, $three = null, $four = null, $five = null)
{
if ($two) {
$fullFilePath = 'uploads'.DIRECTORY_SEPARATOR.$one.DIRECTORY_SEPARATOR.$two;
- 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
CBController
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
class CBController extends Controller
{
public $data_inputan;
public $columns_table;
Method validation
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validation($id = null)
{
$request_all = Request::all();
$array_input = [];
Method postEditSave
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postEditSave($id)
{
$this->cbLoader();
$row = DB::table($this->table)->where($this->primary_key, $id)->first();
Method input_assignment
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function input_assignment($id = null)
{
$hide_form = (request('hide_form')) ? unserialize(request('hide_form')) : [];
Method postAddSave
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postAddSave()
{
$this->cbLoader();
if (! CRUDBooster::isCreate() && $this->global_privilege == false) {
CRUDBooster::insertLog(cbLang('log_try_add_save', [
Function getColumnTable
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function getColumnTable($table, $type = 'list')
{
$this->cbLoader();
$result = [];
- 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 postDoImportChunk
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postDoImportChunk()
{
$this->cbLoader();
$file_md5 = md5(request('file'));
Method getPreview
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPreview($one, $two = null, $three = null, $four = null, $five = null)
{
if ($two) {
$fullFilePath = 'uploads'.DIRECTORY_SEPARATOR.$one.DIRECTORY_SEPARATOR.$two;
File MenusController.php
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php namespace crocodicstudio\crudbooster\controllers;
use CRUDBooster;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
Function sidebarMenu
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function sidebarMenu()
{
$menu_active = DB::table('cms_menus')->whereRaw("cms_menus.id IN (select id_cms_menus from cms_menus_privileges where id_cms_privileges = '".self::myPrivilegeId()."')")->where('parent_id', 0)->where('is_active', 1)->where('is_dashboard', 0)->orderby('sorting', 'asc')->select('cms_menus.*')->get();
foreach ($menu_active as &$menu) {
- 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 getFindData
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFindData()
{
$q = request('q');
$id = request('id');
$limit = request('limit') ?: 10;
Method postAddSave
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postAddSave()
{
$this->cbLoader();
if (! CRUDBooster::isCreate() && $this->global_privilege == false) {
Function checkRequirements
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function checkRequirements()
{
$this->info('System Requirements Checking:');
$system_failed = 0;
$laravel = app();
- 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 checkRequirements
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function checkRequirements()
{
$this->info('System Requirements Checking:');
$system_failed = 0;
$laravel = app();
- 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 ApiCustomController.php
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php namespace crocodicstudio\crudbooster\controllers;
use CRUDbooster;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Excel;
Method checkRequirements
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkRequirements()
{
$this->info('System Requirements Checking:');
$system_failed = 0;
$laravel = app();
Method checkRequirements
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkRequirements()
{
$this->info('System Requirements Checking:');
$system_failed = 0;
$laravel = app();
Method postStep4
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postStep4()
{
$this->cbLoader();
$post = Request::all();