ArthurGuy/BBMembershipSystem

View on GitHub

Showing 174 of 174 total issues

Method receiveNotification has 42 lines of code (exceeds 25 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 1 hr to fix

    Method __construct has 13 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            \BB\Validators\UserValidator $userForm,
            \BB\Validators\UpdateSubscription $updateSubscriptionAdminForm,
            \BB\Helpers\GoCardlessHelper $goCardless,
            \BB\Helpers\UserImage $userImage,
            \BB\Validators\UserDetails $userDetailsForm,
    Severity: Major
    Found in app/Http/Controllers/AccountController.php - About 1 hr to fix

      Method render has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function render($request, Exception $e)
          {
              if ($e instanceof FormValidationException) {
                  if ($request->wantsJson()) {
                      return \Response::json($e->getErrors(), 422);
      Severity: Minor
      Found in app/Exceptions/Handler.php - About 1 hr to fix

        Function store has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            public function store()
            {
                $s3 = AWS::get('s3');
                $s3Bucket = 'buildbrighton-bbms';
        
        
        Severity: Minor
        Found in app/Http/Controllers/CCTVController.php - About 1 hr 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 validateData has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            public function validateData()
            {
                //Verify the keyfob, device key and action
        
                //Validate the action
        Severity: Minor
        Found in app/Services/BuildingAccess.php - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
        Open

            public function handle()
            {
                $proposals = $this->proposalRepository->getUnprocessedFinishedProposals();
                foreach ($proposals as $proposal) {
                    $this->info($proposal->title);
        Severity: Minor
        Found in app/Console/Commands/CalculateProposalVotes.php - About 1 hr 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 constructor has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            constructor() {
        
        
                //var jQuery = require('jquery');
                var jQuery = global.jQuery;
        Severity: Minor
        Found in resources/assets/js/SiteInteraction.js - About 1 hr to fix

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

              constructor() {
          
          
                  var $ = require('jquery');
          
          
          Severity: Minor
          Found in resources/assets/js/FeedbackWidget.js - About 1 hr to fix

            Function render has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                render: function () {
                    var main = <p>Bought an item for Build Brighton, claim the money back here. If your planning on spending over £10
                        please confirm the purchase with a trustee first.</p>;
            
                    //Fetch a list of expenses filtered to the current user
            Severity: Minor
            Found in resources/assets/js/components/expenses/MemberExpenses.js - About 1 hr to fix

              Method up has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function up()
                  {
                      Schema::create('users', function(Blueprint $table)
                      {
                          $table->increments('id');
              Severity: Minor
              Found in database/migrations/2014_07_22_191612_create_users_table.php - About 1 hr to fix

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

                    public function index()
                    {
                        $sortBy       = \Request::get('sortBy', 'created_at');
                        $direction    = \Request::get('direction', 'desc');
                        $dateFilter   = \Request::get('date_filter', '');
                Severity: Minor
                Found in app/Http/Controllers/PaymentController.php - About 1 hr to fix

                  Function handleDevice has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function handleDevice($data)
                      {
                          $sessionId = null;
                          try {
                              $device = ACSNode::where('device_id', $data['device'])->firstOrFail();
                  Severity: Minor
                  Found in app/Http/Controllers/ACSController.php - About 1 hr 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 billMembers has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function billMembers()
                      {
                          $subCharges = $this->subscriptionChargeRepository->getDue();
                  
                          //Check each of the due charges, if they have previous attempted payments ignore them
                  Severity: Minor
                  Found in app/Services/MemberSubscriptionCharges.php - About 1 hr to fix

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

                        public function store()
                        {
                            $input = \Input::only(
                                'given_name',
                                'family_name',
                    Severity: Minor
                    Found in app/Http/Controllers/AccountController.php - About 1 hr to fix

                      Method validateData has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function validateData()
                          {
                              //Verify the keyfob, device key and action
                      
                              //Validate the action
                      Severity: Minor
                      Found in app/Services/BuildingAccess.php - About 1 hr to fix

                        Function handleSubmit has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            handleSubmit() {
                        
                                var $ = require('jquery');
                        
                                if (this.state.stripeLowValueWarning) {
                        Severity: Minor
                        Found in resources/assets/js/components/PaymentModule.js - About 1 hr to fix

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

                              public function store($userId)
                              {
                                  User::findWithPermission($userId);
                          
                                  $requestData = \Request::only(['reason', 'amount', 'return_path', 'stripeToken', 'ref']);
                          Severity: Minor
                          Found in app/Http/Controllers/StripePaymentController.php - About 1 hr to fix

                            Function render has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                render: function() {
                            
                                    var dropdownOptions = [
                                        {key:'', value:''},
                                        {key:'consumables', value:'Consumables'},
                            Severity: Minor
                            Found in resources/assets/js/components/expenses/NewExpenseModal.js - About 1 hr to fix

                              Function correctImageRotation has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private function correctImageRotation($filePath)
                                  {
                                      $exif_data = @exif_read_data($filePath);
                              
                                      //Auto image rotation
                              Severity: Minor
                              Found in app/Helpers/UserImage.php - About 1 hr 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 up has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function up()
                                  {
                                      Schema::create('equipment', function(Blueprint $table)
                                      {
                                          $table->increments('id');
                              Severity: Minor
                              Found in database/migrations/2015_04_16_133712_create_equipment_table.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language