Showing 142 of 174 total issues
Function store
has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring. Open
public function store()
{
$spreadsheetPath = \Input::file('statement')->getRealPath();
$testProcess = \Request::get('test');
- 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
User
has 39 functions (exceeds 20 allowed). Consider refactoring. Open
class User extends Model implements AuthenticatableContract, CanResetPasswordContract {
use UserRoleTrait, PresentableTrait, Authenticatable, CanResetPassword;
Method store
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function store()
{
$spreadsheetPath = \Input::file('statement')->getRealPath();
$testProcess = \Request::get('test');
Method store
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function store($userId)
{
$user = User::findWithPermission($userId);
if ( ! \Auth::user()->hasRole('admin') && ! \Auth::user()->hasRole('finance')) {
PaymentRepository
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class PaymentRepository extends DBRepository
{
/**
* @var Payment
Function receiveNotification
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function receiveNotification()
{
$ipnMessage = new \PayPal\IPN\PPIPNMessage('', PayPalConfig::getConfig());
if ( ! $ipnMessage->validate()) {
- 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 member-admin-action-bar.blade.php
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
@if (Auth::user()->isAdmin())
<div class="row well">
<div class="col-xs-12 col-sm-6">
Method index
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index()
{
$users = $this->userRepository->getActive();
$paymentMethodsNumbers = [
'gocardless' => 0,
Method store
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function store()
{
$s3 = AWS::get('s3');
$s3Bucket = 'buildbrighton-bbms';
Function constructor
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor() {
var $ = require('jquery');
Function store
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function store()
{
$input = \Input::only('subject', 'message', 'send_to_all', 'recipient');
$this->emailNotificationValidator->validate($input);
- 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 adminUpdate
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function adminUpdate($id)
{
$user = User::findWithPermission($id);
$madeTrusted = 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
Equipment
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Equipment extends Model
{
use PresentableTrait;
Function processBills
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function processBills($action, array $bills)
{
foreach ($bills as $bill) {
$existingPayment = $this->paymentRepository->getPaymentBySourceId($bill['id']);
if ($existingPayment) {
- 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 AccountController.php
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php namespace BB\Http\Controllers;
use BB\Entities\Notification;
use BB\Entities\User;
Method adminUpdate
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function adminUpdate($id)
{
$user = User::findWithPermission($id);
$madeTrusted = false;
Function receive
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function receive()
{
$request = \Request::instance();
$webhookData = $request->getContent();
$signature = $request->header('Webhook-Signature');
- 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 index
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function index()
{
$users = $this->userRepository->getActive();
$paymentMethodsNumbers = [
'gocardless' => 0,
- 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 receive
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function receive()
{
$request = \Request::instance();
$webhookData = $request->getContent();
$signature = $request->header('Webhook-Signature');
File User.php
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php namespace BB\Entities;
use BB\Exceptions\AuthenticationException;
use BB\Traits\UserRoleTrait;
use Carbon\Carbon;