ArthurGuy/BBMembershipSystem

View on GitHub

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');
Severity: Minor
Found in app/Http/Controllers/StatementImportController.php - About 1 day 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

User has 39 functions (exceeds 20 allowed). Consider refactoring.
Open

class User extends Model implements AuthenticatableContract, CanResetPasswordContract {

    use UserRoleTrait, PresentableTrait, Authenticatable, CanResetPassword;


Severity: Minor
Found in app/Entities/User.php - About 5 hrs to fix

    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');
    Severity: Major
    Found in app/Http/Controllers/StatementImportController.php - About 4 hrs to fix

      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')) {
      Severity: Major
      Found in app/Http/Controllers/PaymentController.php - About 3 hrs to fix

        PaymentRepository has 28 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class PaymentRepository extends DBRepository
        {
        
            /**
             * @var Payment
        Severity: Minor
        Found in app/Repo/PaymentRepository.php - About 3 hrs to fix

          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()) {
          Severity: Minor
          Found in app/Http/Controllers/PaypalIPNController.php - About 3 hrs 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

          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">
          Severity: Minor
          Found in resources/views/account/partials/member-admin-action-bar.blade.php - About 2 hrs to fix

            Method index has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function index()
                {
                    $users = $this->userRepository->getActive();
                    $paymentMethodsNumbers = [
                        'gocardless'            => 0,
            Severity: Major
            Found in app/Http/Controllers/StatsController.php - About 2 hrs to fix

              Method store has 71 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function store()
                  {
                      $s3 = AWS::get('s3');
                      $s3Bucket = 'buildbrighton-bbms';
              
              
              Severity: Major
              Found in app/Http/Controllers/CCTVController.php - About 2 hrs to fix

                Function constructor has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    constructor() {
                
                
                        var $ = require('jquery');
                
                
                Severity: Major
                Found in resources/assets/js/Snackbar.js - About 2 hrs to fix

                  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);
                  Severity: Minor
                  Found in app/Http/Controllers/NotificationEmailController.php - About 2 hrs 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 adminUpdate has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function adminUpdate($id)
                      {
                          $user = User::findWithPermission($id);
                  
                          $madeTrusted = false;
                  Severity: Minor
                  Found in app/Http/Controllers/AccountController.php - About 2 hrs 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

                  Equipment has 24 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Equipment extends Model
                  {
                  
                      use PresentableTrait;
                  
                  
                  Severity: Minor
                  Found in app/Entities/Equipment.php - About 2 hrs to fix

                    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) {
                    Severity: Minor
                    Found in app/Http/Controllers/GoCardlessWebhookController.php - About 2 hrs 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

                    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;
                    Severity: Minor
                    Found in app/Http/Controllers/AccountController.php - About 2 hrs to fix

                      Method adminUpdate has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function adminUpdate($id)
                          {
                              $user = User::findWithPermission($id);
                      
                              $madeTrusted = false;
                      Severity: Major
                      Found in app/Http/Controllers/AccountController.php - About 2 hrs to fix

                        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');
                        Severity: Minor
                        Found in app/Http/Controllers/GoCardlessWebhookController.php - About 2 hrs 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 index has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function index()
                            {
                                $users = $this->userRepository->getActive();
                                $paymentMethodsNumbers = [
                                    'gocardless'            => 0,
                        Severity: Minor
                        Found in app/Http/Controllers/StatsController.php - About 2 hrs 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

                        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');
                        Severity: Major
                        Found in app/Http/Controllers/GoCardlessWebhookController.php - About 2 hrs to fix

                          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;
                          Severity: Minor
                          Found in app/Entities/User.php - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language