ArthurGuy/BBMembershipSystem

View on GitHub

Showing 174 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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          var NotificationCount = React.createClass({
              mixins: [BackboneMixin],
          
              getBackboneCollections: function () {
                  return [this.props.notifications];
          resources/assets/js/components/expenses/ExpensesCount.js on lines 5..23

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 100.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

              it('adds style class correctly', function() {
          
                  var React = require('react/addons');
                  var TestUtils = React.addons.TestUtils;
          
          
          resources/assets/js/__tests__/components/form/Select.test.js on lines 7..19
          resources/assets/js/__tests__/components/form/Select.test.js on lines 21..33

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 100.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

              it('renders help correctly', function() {
          
                  var React = require('react/addons');
                  var TestUtils = React.addons.TestUtils;
          
          
          resources/assets/js/__tests__/components/form/Select.test.js on lines 7..19
          resources/assets/js/__tests__/components/form/Select.test.js on lines 35..47

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 100.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

              it('renders label correctly', function() {
          
                  var React = require('react/addons');
                  var TestUtils = React.addons.TestUtils;
          
          
          resources/assets/js/__tests__/components/form/Select.test.js on lines 21..33
          resources/assets/js/__tests__/components/form/Select.test.js on lines 35..47

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 100.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          var ExpensesCount = React.createClass({
              mixins: [BackboneMixin],
          
              getBackboneCollections: function () {
                  return [this.props.expenses];
          Severity: Major
          Found in resources/assets/js/components/expenses/ExpensesCount.js and 1 other location - About 3 hrs to fix
          resources/assets/js/components/notifications/NotificationCount.js on lines 5..23

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 100.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              <?php
              
              namespace BB\Listeners;
              
              use BB\Events\SubscriptionPayment;
              app/Listeners/EmailMemberAboutFailedSubscriptionPayment.php on lines 1..45

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 140.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              <?php
              
              namespace BB\Listeners;
              
              use BB\Events\SubscriptionPayment;
              Severity: Major
              Found in app/Listeners/EmailMemberAboutFailedSubscriptionPayment.php and 1 other location - About 2 hrs to fix
              app/Listeners/EmailMemberAboutFailedSubscriptionPaymentGoingToBackup.php on lines 1..45

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 140.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              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
                    Severity
                    Category
                    Status
                    Source
                    Language