Showing 132 of 160 total issues
Function getIndex
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getIndex()
{
$this->cbLoader();
$module = CRUDBooster::getCurrentModule();
- 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 userControllerRoute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function userControllerRoute() {
Route::group([
'middleware' => ['web', '\crocodicstudio\crudbooster\middlewares\CBBackend'],
'prefix' => config('crudbooster.ADMIN_PATH'),
'namespace' => 'App\Http\Controllers',
- 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
Avoid deeply nested control flow statements. Open
if (! Hash::check($value, $rows->{$name})) {
$result['api_status'] = 0;
$result['api_message'] = 'Invalid credentials. Check your username and password.';
goto show;
Function valid
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function valid($arr = [], $type = 'json')
{
$input_arr = Request::all();
foreach ($arr as $a => $b) {
- 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 getModulePath
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getModulePath()
{
// Check to position of admin_path
if(config("crudbooster.ADMIN_PATH")) {
$adminPathSegments = explode('/', Request::path());
- 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 postStepFinish
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function postStepFinish()
{
$this->cbLoader();
$id = Request::input('id');
$row = DB::table('cms_moduls')->where('id', $id)->first();
- 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 postSaveApiCustom
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function postSaveApiCustom()
{
$this->cbLoader();
$posts = Request::all();
- 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 postActionSelected
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function postActionSelected()
{
$this->cbLoader();
$id_selected = Request::input('checkbox');
$button_name = Request::input('button_name');
- 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 getPreview
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getPreview($one, $two = null, $three = null, $four = null, $five = null)
Method uploadFile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function uploadFile($name, $encrypt = false, $resize_width = null, $resize_height = null, $id = null)
Method resizeImage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private static function resizeImage($fullFilePath, $resize_width = null, $resize_height = null, $qty = 100, $thumbQty = 75)
Method get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function get($table, $string_conditions = null, $orderby = null, $limit = null, $skip = null)
Function sendEmail
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function sendEmail($config = [])
{
\Config::set('mail.driver', self::getSetting('smtp_driver'));
\Config::set('mail.host', self::getSetting('smtp_host'));
- 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 checkHideForm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function checkHideForm()
{
if ($this->hide_form && count($this->hide_form)) {
foreach ($this->form as $i => $f) {
if (in_array($f['name'], $this->hide_form)) {
- 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 min_var_export
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function min_var_export($input) {
if(is_array($input)) {
$buffer = [];
foreach($input as $key => $value)
$buffer[] = var_export($key, true)."=>".min_var_export($value);
- 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
Avoid too many return
statements within this method. Open
return redirect()->action($menus->path);
Avoid too many return
statements within this method. Open
return redirect()->action($action);
Avoid too many return
statements within this method. Open
return Response::file(storage_path('app/'.$fullFilePath), $headers);
Avoid too many return
statements within this method. Open
return $result;
Avoid too many return
statements within this method. Open
return new Mailqueues;