madbob/GASdottoNG

View on GitHub

Showing 435 of 490 total issues

Function destroy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function destroy($id)
    {
        $product = DB::transaction(function() use ($id) {
            $product = $this->show($id);
            $this->ensureAuth(['supplier.modify' => $product->supplier]);
Severity: Minor
Found in code/app/Services/ProductsService.php - About 25 mins 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 enforceMeasureDiscrete has a Cognitive Complexity of 6 (exceeds 5 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');
Severity: Minor
Found in code/resources/assets/js/gasdotto.js - About 25 mins 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 fastShipping has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function fastShipping($deliverer, $aggregate, $users = null)
    {
        DB::beginTransaction();

        $service = app()->make('BookingsService');
Severity: Minor
Found in code/app/Services/FastBookingsService.php - About 25 mins 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 list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function list($start, $end, $supplier_id, $user_id = 0)
    {
        if ($user_id == '0') {
            $this->ensureAuth(['movements.admin' => 'gas']);
        }
Severity: Minor
Found in code/app/Services/ReceiptsService.php - About 25 mins 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 saveValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function saveValue($modifier, $obj_mod_target, $altered_amount)
    {
        $modifier_value = $this->retrieveExistingValue($modifier, $obj_mod_target);

        /*
Severity: Minor
Found in code/app/Singletons/ModifierEngine.php - About 25 mins 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 creditHistory has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function creditHistory($class, $date)
    {
        $currencies = Currency::enabled();
        $balances = Balance::whereDate('date', $date)->where('target_type', $class)->get();
        $ret = [];
Severity: Minor
Found in code/app/Services/MovementsService.php - About 25 mins 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 getPrintableUpdaterAttribute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPrintableUpdaterAttribute()
    {
        $last_update = null;
        $last_updater = null;

Severity: Minor
Found in code/app/AggregateBooking.php - About 25 mins 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 evaluateEmptyBooking has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    static evaluateEmptyBooking(form) {
        if (form.find('input:hidden[name=action]').val() == 'shipped') {
            var test = false;

            form.find('.booking-total').each(function() {
Severity: Minor
Found in code/resources/assets/js/callables.js - About 25 mins 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 attachUser has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function attachUser($user_id, $role_id, $target)
    {
        $this->checkAccessToRole($role_id);
        $r = Role::findOrFail($role_id);
        $u = User::tFind($user_id, true);
Severity: Minor
Found in code/app/Services/RolesService.php - About 25 mins 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 iterateUsers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function iterateUsers($users, $gas, $amount)
    {
        $auto_fee = $gas->getConfig('auto_fee');

        foreach($users as $user) {
Severity: Minor
Found in code/app/Console/Commands/CheckFees.php - About 25 mins 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 basicSummaryForAll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function basicSummaryForAll($start, $end, $target)
    {
        $data = [];
        $bookings = $this->createBookingQuery(Booking::query(), 'all', $start, $end, $target, null)->angryload()->get();

Severity: Minor
Found in code/app/Http/Controllers/StatisticsController.php - About 25 mins 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 columnsByFeatures has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function columnsByFeatures($ret)
    {
        $current_gas = currentAbsoluteGas();

        if ($current_gas->hasFeature('shipping_places')) {
Severity: Minor
Found in code/app/Formatters/User.php - About 25 mins 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 testInternalFunctionsAccess has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function testInternalFunctionsAccess($requester, $target, $type)
    {
        $admin_editable = $requester->can('users.admin', $target->gas);
        $access = ($admin_editable || $requester->id == $target->id || $target->parent_id == $requester->id);

Severity: Minor
Found in code/app/Http/Controllers/UsersController.php - About 25 mins 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 readDate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function readDate($date)
{
    if (preg_match('/\d{1,2}\/\d{1,2}\/\d{1,4}/', $date) == 1) {
        list($day, $month, $year) = explode('/', $date);
        if ($year < 1000)
Severity: Minor
Found in code/app/Helpers/Dates.php - About 25 mins 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 format has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function format($obj, $fields, $context = null)
    {
        $columns = static::formattableColumns('all');
        $ret = [];

Severity: Minor
Found in code/app/Formatters/Formatter.php - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function handle()
    {
        $today = date('Y-m-d');

        foreach(Gas::all() as $gas) {
Severity: Minor
Found in code/app/Console/Commands/CheckFees.php - About 25 mins 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 create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function create(Request $request)
    {
        $type = $request->input('type', null);
        if (is_null($type)) {
            return view('movement.create');
Severity: Minor
Found in code/app/Http/Controllers/MovementsController.php - About 25 mins 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 calculateInvoicingSummary has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function calculateInvoicingSummary()
    {
        $summary = (object) [
            'order' => $this->id,
            'total' => 0,
Severity: Minor
Found in code/app/Order.php - About 25 mins 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 systemParameters has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function systemParameters($type)
{
    static $types = [];

    if (!isset($types[$type])) {
Severity: Minor
Found in code/app/Helpers/Reflection.php - About 25 mins 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 decodePeriodic has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function decodePeriodic($value)
{
    if (empty($value))
        return '';

Severity: Minor
Found in code/app/Helpers/Dates.php - About 25 mins 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

Severity
Category
Status
Source
Language