Showing 437 of 494 total issues
Function select
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
select: function(event, ui) {
var aggregate_id = input.attr('data-aggregate');
var while_shipping = (input.closest('.modal.add-booking-while-shipping').length != 0);
var fill_target = input.closest('.fillable-booking-space').find('.other-booking');
fill_target.empty().append(utils.j().makeSpinner());
Method testAccess
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function testAccess($modifier)
{
switch($modifier->target_type) {
case 'App\Supplier':
$this->ensureAuth(['supplier.modify' => $modifier->target]);
Method getHistoryDetails
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getHistoryDetails(Request $request)
{
$this->checkAuth();
$date = $request->input('date');
Method handleSave
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleSave($gas, $request)
{
$satispay_info = null;
if ($request->has('enable_satispay')) {
Method notify
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function notify($supplier, $e)
{
$body = _i('Nuovo aggiornamento disponibile per il listino %s (%s). Consultalo dal pannello Fornitori -> Indice Remoto.', [$supplier->printableName(), printableDate($e->lastchange)]);
if (Notification::where('content', $body)->first() == null) {
$gas = Gas::all();
Method exportIntegralCES
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function exportIntegralCES($gas, $objects, $filename, $body)
{
$currency = Currency::where('context', 'integralces')->first();
return output_csv($filename, null, $objects, function($object) use ($gas, $currency, $body) {
Method userBooking
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function userBooking($userid = null)
{
$userobj = null;
if (is_null($userid)) {
Method up
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
Schema::create('products', function (Blueprint $table) {
$table->string('id')->primary();
$table->timestamps();
Method hasChangedProdcts
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function hasChangedProdcts()
{
$has_changed_products = false;
if ($this->isActive()) {
Method up
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->string('id')->primary();
$table->timestamps();
Function enforceMeasureDiscrete
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function enforceMeasureDiscrete(node) {
var form = node.closest('form');
var selected = node.find('option:selected').val();
var discrete = measure_discrete[selected];
var disabled = (discrete == '1');
Method pendingPackages
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function pendingPackages()
{
return $this->innerCache('pending_packages', function($obj) {
$ret = new Collection();
$products = $obj->products()->where('package_size', '!=', 0)->with('measure')->get();
Method show
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show(Request $request, $id)
{
$start = decodeDate($request->input('startdate'));
$end = decodeDate($request->input('enddate'));
$target = fromInlineId($request->input('target'));
Method importJSON
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function importJSON($target, $json)
{
$type = $json->type;
/*
Method storeUploadedFile
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function storeUploadedFile($request, $parameters)
{
try {
$f = $request->file('file', null);
if (is_null($f) || $f->isValid() == false) {
Function bookingTotal
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
static bookingTotal(editor) {
var form = $(editor).closest('form');
var data = this.serializeBooking(form);
var url = form.attr('data-dynamic-url');
- 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 commons
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function commons($user)
{
$ret = [];
if ($user->can('users.admin', $user->gas)) {
- 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 readRID
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function readRID($user, $request)
{
if ($user->gas->hasFeature('rid')) {
$rid = $user->rid;
$changed = 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"
Further reading
Function testConstraints
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function testConstraints($quantity, $variant = null, $only_mandatory = false)
{
$sorted_contraints = Constraint::sortedContraints($only_mandatory);
foreach($sorted_contraints as $constraints) {
foreach($constraints as $constraint) {
- 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 fixModifiers
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function fixModifiers($id, $action)
{
switch($action) {
case 'none':
break;
- 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"