ArthurGuy/BBMembershipSystem

View on GitHub

Showing 142 of 174 total issues

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

          Method handle has 31 lines of code (exceeds 25 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

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

              Method recordPayment has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function recordPayment($reason, $userId, $source, $sourceId, $amount, $status = 'paid', $fee = 0.0, $ref = '', Carbon $paidDate = null)
              Severity: Major
              Found in app/Repo/PaymentRepository.php - About 1 hr to fix

                Method destroy has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function destroy($userId, $id = null)
                    {
                        /**
                         * TODO: Check for and cancel pending sub charges
                         */
                Severity: Minor
                Found in app/Http/Controllers/SubscriptionController.php - About 1 hr to fix

                  Function updateSubPayment has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function updateSubPayment($paymentId, $userId, $status)
                      {
                          $payment   = $this->paymentRepository->getById($paymentId);
                          $subCharge = $this->subscriptionChargeRepository->findCharge($userId);
                  
                  
                  Severity: Minor
                  Found in app/Handlers/PaymentEventHandler.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 handleSubmit has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      handleSubmit: function(event) {
                          event.preventDefault();
                  
                          this.setState({submitAttempt:true, requestInProgress:true});
                  
                  
                  Severity: Minor
                  Found in resources/assets/js/components/expenses/NewExpenseModal.js - About 1 hr to fix

                    Method reason has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function reason()
                        {
                            switch ($this->entity->reason) {
                                case 'subscription':
                                    return 'Subscription';
                    Severity: Minor
                    Found in app/Presenters/PaymentPresenter.php - About 1 hr to fix

                      Method setResults has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function setResults($proposalId, $result, $votesCast, $for, $against, $neutral, $abstentions, $quorum)
                      Severity: Major
                      Found in app/Repo/ProposalRepository.php - About 1 hr to fix

                        Method recordSubscriptionPayment has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function recordSubscriptionPayment($userId, $source, $sourceId, $amount, $status = 'paid', $fee = 0.0, $ref = '', Carbon $paidDate = null)
                        Severity: Major
                        Found in app/Repo/PaymentRepository.php - About 1 hr to fix

                          Function validateData has a Cognitive Complexity of 9 (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/DeviceSession.php - About 55 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 handleBill has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private function handleBill($amount, $reason, $user, $ref, $returnPath)
                              {
                                  if (is_null($ref)) {
                                      $ref = '';
                                  }
                          Severity: Minor
                          Found in app/Http/Controllers/GoCardlessPaymentController.php - About 55 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 ensureMembershipActive has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function ensureMembershipActive($userId)
                              {
                                  /** @var User $user */
                                  $user = $this->getById($userId);
                          
                          
                          Severity: Minor
                          Found in app/Repo/UserRepository.php - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function handle()
                              {
                                  //Close records that were left open
                                  $records = $this->equipmentLogRepository->getActiveRecords();
                                  foreach ($records as $log) {
                          Severity: Minor
                          Found in app/Console/Commands/CheckFixEquipmentLog.php - About 55 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 update has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function update($boxId)
                              {
                                  $userId = \Request::get('user_id');
                          
                                  if ($userId) {
                          Severity: Minor
                          Found in app/Http/Controllers/StorageBoxController.php - About 45 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 fetchNextRecord has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private function fetchNextRecord($userId, $device, $reason, \DateTime $finishedDate)
                              {
                                  foreach ($this->logEntries as $entry) {
                                      if (($entry['user_id'] == $userId) && ($entry['device'] == $device) && ($entry['reason'] == $reason)) {
                                          if (($entry['started']->gt($finishedDate)) && ($entry['started']->diffInSeconds($finishedDate) <= 60)) {
                          Severity: Minor
                          Found in app/Services/CombineEquipmentLogs.php - About 45 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