Showing 494 of 494 total issues
Method systemInit
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function systemInit($mov)
{
$mov->callbacks = [
'pre' => function (Movement $movement) {
/*
Function unrollSpecialSelectors
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function unrollSpecialSelectors($users)
{
$map = [];
if (!is_array($users)) {
- 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 handleSummary
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function handleSummary($obj, $request)
{
$subtype = $request['format'] ?? 'pdf';
if ($subtype == 'gdxp') {
- 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 run
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function run($request)
{
DB::beginTransaction();
$direct_fields = ['name', 'weight', 'description', 'price', 'supplier_code', 'package_size', 'min_quantity', 'multiple', 'portion_quantity'];
- 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 ModifierEngine.php
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Singletons;
use Illuminate\Support\Facades\Log;
Function iconsLegendTrigger
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
static iconsLegendTrigger(node, legend_class)
{
/*
Se clicco l'intestazione di un dropdown, passo oltre. Qui interviene
il JS di Bootstrap per aprire e chiudere il dropdown stesso
Method handleShipping
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function handleShipping($obj, $request)
{
$action = $request['action'] ?? 'download';
$subtype = $request['format'] ?? 'pdf';
$status = $request['status'] ?? 'pending';
File Products.php
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Importers\CSV;
use DB;
File summary.blade.php
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
$summary = $master_summary->orders[$order->id];
$columns = $currentgas->orders_display_columns;
Method handleSummary
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function handleSummary($obj, $request)
{
$action = $request['action'] ?? 'download';
$subtype = $request['format'] ?? 'pdf';
$extra_modifiers = $request['extra_modifiers'] ?? 0;
Similar blocks of code found in 2 locations. Consider refactoring. Open
else {
let min = parseInt(i.val()) + 1;
peer.attr('min', min);
peer.removeAttr('max');
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 77.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (action == 'ship') {
let max = parseInt(i.val()) - 1;
peer.attr('max', max);
peer.removeAttr('min');
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 77.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function targetDefinition
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function targetDefinition($modifier, $value)
{
if ($modifier->scale == 'minor') {
foreach($modifier->definitions as $def) {
if ($value < $def->threshold) {
- 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 getBookingsAttribute
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getBookingsAttribute()
{
$ret = [];
foreach ($this->orders as $order) {
- 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 widgets.js
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
require('bootstrap-datepicker');
require('select2');
import utils from "./utils";
Function updateBookingQuantities
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
static updateBookingQuantities(dynamic_data, container, action)
{
for (let [product_id, product_meta] of Object.entries(dynamic_data)) {
var inputbox = $('input[name="' + product_id + '"]', container);
inputbox.closest('tr').find('.booking-product-price span').text(utils.priceRound(product_meta.total));
File UsersController.php
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
Method formattableColumns
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function formattableColumns($type = null)
{
$ret = [
'name' => (object) [
'name' => _i('Nome Prodotto'),
Similar blocks of code found in 3 locations. Consider refactoring. Open
$type->function = json_encode($this->voidFunctions([
(object) [
'method' => 'cash',
'target' => $this->format(['bank' => 'increment']),
'master' => $this->format(['cash' => 'increment']),
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 121.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
$type->function = json_encode($this->voidFunctions([
(object) [
'method' => 'cash',
'target' => $this->format(['bank' => 'decrement']),
'sender' => $this->format(['cash' => 'decrement']),
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 121.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76