Showing 132 of 160 total issues
Method resizeImage
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function resizeImage($fullFilePath, $resize_width = null, $resize_height = null, $qty = 100, $thumbQty = 75)
{
$images_ext = config('crudbooster.IMAGE_EXTENSIONS', 'jpg,png,gif,bmp');
$images_ext = explode(',', $images_ext);
Function cbRoute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private static function cbRoute() {
Route::group([
'middleware' => ['web', '\crocodicstudio\crudbooster\middlewares\CBBackend'],
'prefix' => config('crudbooster.ADMIN_PATH'),
'namespace' => static::$cb_namespace,
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public function handle($request, Closure $next)
{
$admin_path = config('crudbooster.ADMIN_PATH') ?: 'admin';
if (CRUDBooster::myId() == '') {
- 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 getColumnTable
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getColumnTable($table, $type = 'list')
{
$this->cbLoader();
$result = [];
Method handle
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
$this->header();
$this->checkRequirements();
Method uploadFile
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function uploadFile($name, $encrypt = false, $resize_width = null, $resize_height = null, $id = null)
{
if (Request::hasFile($name)) {
if (! self::myId()) {
$userID = 0;
Method postActionSelected
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postActionSelected()
{
$this->cbLoader();
$id_selected = Request::input('checkbox');
$button_name = Request::input('button_name');
Method postLogin
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postLogin()
{
$validator = Validator::make(Request::all(), [
'email' => 'required|email|exists:'.config('crudbooster.USER_TABLE'),
Method sendEmailQueue
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function sendEmailQueue($queue)
{
\Config::set('mail.driver', self::getSetting('smtp_driver'));
\Config::set('mail.host', self::getSetting('smtp_host'));
\Config::set('mail.port', self::getSetting('smtp_port'));
Function authAPI
has a Cognitive Complexity of 11 (exceeds 5 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');
- 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 postSaveSetting
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function postSaveSetting()
{
if (! CRUDBooster::isSuperadmin()) {
CRUDBooster::insertLog(cbLang("log_try_view", ['name' => 'Setting', 'module' => 'Setting']));
- 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 getNameTable
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function getNameTable($columns)
{
$name_col_candidate = config('crudbooster.NAME_FIELDS_CANDIDATE');
$name_col_candidate = explode(',', $name_col_candidate);
$name_col = '';
- 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 resizeImage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private static function resizeImage($fullFilePath, $resize_width = null, $resize_height = null, $qty = 100, $thumbQty = 75)
{
$images_ext = config('crudbooster.IMAGE_EXTENSIONS', 'jpg,png,gif,bmp');
$images_ext = explode(',', $images_ext);
- 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 getUrlParameters
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function getUrlParameters($exception = null)
{
@$get = $_GET;
$inputhtml = '';
- 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 postStep2
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function postStep2()
{
$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 getImportData
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getImportData()
{
$this->cbLoader();
$data['page_menu'] = Route::getCurrentRoute()->getActionName();
$data['page_title'] = 'Import Data';
- 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 isForeignKey
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function isForeignKey($fieldName)
{
if (substr($fieldName, 0, 3) == 'id_') {
$table = substr($fieldName, 3);
} elseif (substr($fieldName, -3) == '_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 sendFCM
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function sendFCM($regID = [], $data)
{
if (! $data['title'] || ! $data['content']) {
return 'title , content null !';
}
Method postStepFinish
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postStepFinish()
{
$this->cbLoader();
$id = Request::input('id');
$row = DB::table('cms_moduls')->where('id', $id)->first();
Method postAddSave
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postAddSave()
{
$this->cbLoader();
if (! CRUDBooster::isCreate() && $this->global_privilege == false) {