Showing 160 of 160 total issues
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 generateAPI
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function generateAPI($controller_name, $table_name, $permalink, $method_type = 'post')
{
$php = '
<?php namespace App\Http\Controllers;
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 getStep2
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStep2($id)
{
$this->cbLoader();
$module = CRUDBooster::getCurrentModule();
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 routeController
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function routeController($prefix, $controller, $namespace = null)
{
$prefix = trim($prefix, '/').'/';
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 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 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 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 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 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"