Showing 160 of 160 total issues
Method getStep2
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStep2($id)
{
$this->cbLoader();
$module = CRUDBooster::getCurrentModule();
Method getModalData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getModalData()
{
$table = request('table');
$where = request('where');
$where = urldecode($where);
Method authAPI
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function authAPI()
{
$allowedUserAgent = config('crudbooster.API_USER_AGENT_ALLOWED');
$user_agent = Request::header('User-Agent');
$authorization = Request::header('Authorization');
Method cbInit
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cbInit()
{
$this->table = 'cms_logs';
$this->primary_key = 'id';
$this->title_field = "ipaddress";
Method userControllerRoute
has 28 lines of code (exceeds 25 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',
Function postEditSave
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function postEditSave($id)
{
$this->cbLoader();
$row = CRUDBooster::first($this->table, $id);
- 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 postExportData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postExportData()
{
ini_set('memory_limit', '1024M');
set_time_limit(180);
Method routeController
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function routeController($prefix, $controller, $namespace = null)
{
$prefix = trim($prefix, '/').'/';
Method getImportData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getImportData()
{
$this->cbLoader();
$data['page_menu'] = Route::getCurrentRoute()->getActionName();
$data['page_title'] = 'Import Data';
Method getIndex
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getIndex()
{
$this->cbLoader();
$module = CRUDBooster::getCurrentModule();
Function routeController
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function routeController($prefix, $controller, $namespace = null)
{
$prefix = trim($prefix, '/').'/';
- 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 isCRUD
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function isCRUD()
{
if (self::isSuperadmin()) {
return true;
}
- 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 postAddSave
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function postAddSave()
{
$this->cbLoader();
if (! CRUDBooster::isCreate() && $this->global_privilege == false) {
- 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
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
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 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 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"