crocodic-studio/crudbooster

View on GitHub

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);

Severity: Minor
Found in src/helpers/CRUDBooster.php - About 1 hr to fix

    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,
    Severity: Minor
    Found in src/helpers/CBRouter.php - About 1 hr to fix

    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() == '') {
    Severity: Minor
    Found in src/middlewares/CBBackend.php - About 1 hr to fix

    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 = [];
    
    
    Severity: Minor
    Found in src/controllers/ApiCustomController.php - About 1 hr to fix

      Method handle has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function handle()
          {
      
              $this->header();
              $this->checkRequirements();
      Severity: Minor
      Found in src/commands/CrudboosterUpdateCommand.php - About 1 hr to fix

        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;
        Severity: Minor
        Found in src/helpers/CRUDBooster.php - About 1 hr to fix

          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');
          Severity: Minor
          Found in src/controllers/CBController.php - About 1 hr to fix

            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'),
            Severity: Minor
            Found in src/controllers/AdminController.php - About 1 hr to fix

              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'));
              Severity: Minor
              Found in src/helpers/CRUDBooster.php - About 1 hr to fix

                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');
                Severity: Minor
                Found in src/helpers/CRUDBooster.php - About 1 hr to fix

                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']));
                Severity: Minor
                Found in src/controllers/SettingsController.php - About 1 hr to fix

                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 = '';
                Severity: Minor
                Found in src/helpers/CRUDBooster.php - About 1 hr to fix

                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);
                
                
                Severity: Minor
                Found in src/helpers/CRUDBooster.php - About 1 hr to fix

                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 = '';
                
                
                Severity: Minor
                Found in src/helpers/CRUDBooster.php - About 1 hr to fix

                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();
                Severity: Minor
                Found in src/controllers/ModulsController.php - About 1 hr to fix

                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';
                Severity: Minor
                Found in src/controllers/CBController.php - About 1 hr to fix

                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') {
                Severity: Minor
                Found in src/helpers/CRUDBooster.php - About 1 hr to fix

                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 !';
                        }
                Severity: Minor
                Found in src/helpers/CRUDBooster.php - About 1 hr to fix

                  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();
                  Severity: Minor
                  Found in src/controllers/ModulsController.php - About 1 hr to fix

                    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) {
                    Severity: Minor
                    Found in src/controllers/PrivilegesController.php - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language