Showing 46 of 93 total issues
Method run
has 1276 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
DB::table('locales')->insert([
[
'code' => 'en',
File LocalesSeeder.php
has 1286 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
File step1.blade.php
has 763 lines of code (exceeds 250 allowed). Consider refactoring. Open
@push('scripts')
<script src="{{ asset('public/js/admin/module/step1.js') }}"></script>
<script src="{{ asset('public/js/admin/pluralize.js') }}"></script>
@endpush
<div class="tab-pane active" id="tab_1">
File step3.blade.php
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
@push('css')
<style>
.table-form tbody tr td {
position: relative;
}
Function handle
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function handle($request, Closure $next)
{
$routeName = str_replace([$request->route()->action['prefix'] . '.', 'store', 'update'], ['', 'create', 'edit'], $request->route()->action['as']);
$permissionName = ($routeName == "") ? "dashboard" : $routeName;
- 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
File pluralize.js
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* global define */
(function (root, pluralize) {
/* istanbul ignore else */
if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {
File step2.blade.php
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
@push('css')
<style>
.table-display tbody tr td {
position: relative;
}
Method postStep3
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postStep3(UpdateModuleConfigRequest $request)
{
$this->data['id'] = $request->id;
$tablename = Module::where('id', $request->id)->get()->first();
// $this->data['tableFields'] = DB::select('SHOW FULL FIELDS FROM '.$tablename->table_name);
Method up
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
Method index
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index()
{
//echo '<script>alert("add authentication pram in API swagger doc")</script>';
if (App::environment() == 'staging') {
$this->menuRepository->update(['status' => 0], 5);
Function customLoad
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.customLoad = function () {
//Timepicker
// $('.timepicker').timepicker({
// showInputs: false,
// containerClass: 'bootstrap-timepicker',
Method sendPushNotifications
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sendPushNotifications($msg = '', $deviceObject = [], $extraPayLoadData = [])
{
$androidDeviceToken = [];
$iosDeviceToken = [];
Method run
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
DB::table('users')->insert([
[
'name' => "Super Admin",
Method apply
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function apply($model, RepositoryInterface $repository)
{
// Check if Role Property is set
if ($this->isset('role')) {
// If Role Property is set, add a condition to include only those users who have this role
Function apply
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function apply($model, RepositoryInterface $repository)
{
// Check if Role Property is set
if ($this->isset('role')) {
// If Role Property is set, add a condition to include only those users who have this role
- 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 up
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
DB::beginTransaction();
// Create table for storing roles
Method Register
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function Register($modelName = null, $BreadCrumbName = null, $model = null, $profile = false)
{
$prefixes = config('infyom.laravel_generator.prefixes.route');
$routeName = $prefixes . '.' . $modelName;
Function readCSV
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function readCSV($file, $colName = 0)
{
$row = 0;
$rows = $columns = [];
$autoLineEndings = ini_get('auto_detect_line_endings');
- 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 socialLogin
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function socialLogin(SocialLoginAPIRequest $request)
{
$user = false;
$input = $request->all();
$account = $this->socialAccountRepository->findWhere(['platform' => $input['platform'], 'client_id' => $input['client_id'], 'deleted_at' => null])->first();
Method updated
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updated(Module $module)
{
if ($module->getOriginal('status') != $module->status && $module->status == 1) {
$util = new Util();
//$pieces = preg_split('/(?=[A-Z])/', $module->name);