Showing 437 of 494 total issues
Method up
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function up()
{
Schema::create('orders', function (Blueprint $table) {
$table->string('id')->primary();
$table->timestamps();
Method roleInit
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function roleInit($gas)
{
$queue = systemParameters('Roles');
while(true) {
Method dynamicModifiers
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function dynamicModifiers(array $request, $aggregate, $target_user)
{
/*
Innanzitutto, qui sospendo l'esecuzione delle callback sui movimenti
contabili. Nella fase di revisione della prenotazione capita che i
Method initCollectionMacros
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function initCollectionMacros()
{
/*
Questa va usata solo per una Collection di BookedProductVariant,
come ad esempio la relazione variants() di BookedProduct
Method getSupplier
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getSupplier($start, $end, $type, $target, $supplier)
{
$data = [];
$categories = [];
Method closeBalance
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function closeBalance($request)
{
$this->ensureAuth(['movements.admin' => 'gas']);
$hub = App::make('MovementsHub');
Method distributionLabels
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function distributionLabels()
{
$currency = defaultCurrency()->symbol;
return [
Method columnsByType
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function columnsByType($ret, $type)
{
if ($type == 'export' || $type == 'all') {
$ret['last_login'] = (object) [
'name' => _i('Ultimo Accesso'),
Method iban_split
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function iban_split($iban, $field)
{
switch($field) {
case 'country':
$start = 0;
Method otherFields
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function otherFields(&$ret)
{
$ret['birthplace'] = (object) [
'label' => _i('Luogo di Nascita'),
];
Method up
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function up()
{
Schema::create('suppliers', function (Blueprint $table) {
$table->string('id')->primary();
$table->timestamps();
Method postCsv
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function postCsv(Request $request)
{
$type = $request->input('type');
$step = $request->input('step', 'guess');
Method postGdxp
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function postGdxp(Request $request)
{
// try {
$archivepath = '';
$working_dir = sys_get_temp_dir();
Method handle
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle()
{
$orders = Order::where('status', 'open')->where('end', '>', Carbon::today()->format('Y-m-d'))->get();
$notifications = [];
Method show
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function show(Request $request, $id)
{
$user = Auth::user();
$format = $request->input('format', 'html');
Method show
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function show(Request $request, $id)
{
$dom_id = $request->input('dom_id', rand());
try {
Method getBookingsAttribute
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getBookingsAttribute()
{
$ret = [];
foreach ($this->orders as $order) {
Method handleTable
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function handleTable($obj, $request)
{
$action = $request['action'] ?? 'download';
$status = $request['status'] ?? 'pending';
$include_missing = $request['include_missing'] ?? 'no';
Function filterBySupplier
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
private function filterBySupplier($supplier, $user, $query, $own)
{
$type = 'all';
if ($supplier) {
- 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 testAccess
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function testAccess($target, $orders, $delivering)
{
$user = Auth::user();
$valid = 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"