aspushkinus/take_dat_shit

View on GitHub

Showing 7 of 7 total issues

Function ToiletController has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function ToiletController( toiletService, $mdSidenav, $mdBottomSheet, $log, $scope ) {
    var self = this;

    self.selected     = null;
    self.toilets      = [ ];
Severity: Minor
Found in app/assets/javascripts/app/ToiletController.js - About 1 hr to fix

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

      function ToiletService($q, Toilet) {
        var toilets = [
          {
            name: 'Lia Lugo',
            avatar: 'svg-1',
    Severity: Minor
    Found in app/assets/javascripts/app/ToiletService.js - About 1 hr to fix

      Function timeAgoInWords has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var timeAgoInWords = function(from) {
        var minutes = (new Date() - from) / 60000;
      
        if (minutes < 0) {
          minutes = 0;
      Severity: Minor
      Found in app/assets/javascripts/home.js - About 1 hr to fix

        Function ToiletController has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          function ToiletController( toiletService, $mdSidenav, $mdBottomSheet, $log, $scope ) {
        Severity: Minor
        Found in app/assets/javascripts/app/ToiletController.js - About 35 mins to fix

          Function timeAgoInWords has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          var timeAgoInWords = function(from) {
            var minutes = (new Date() - from) / 60000;
          
            if (minutes < 0) {
              minutes = 0;
          Severity: Minor
          Found in app/assets/javascripts/home.js - About 35 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

          Method generate_auth_token has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            def generate_auth_token
              return unless self.new_record?
          
              loop do
                self.auth_token = SecureRandom.hex
          Severity: Minor
          Found in app/models/user.rb - About 25 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

          Method require_user_signed_in has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            def require_user_signed_in
              unless user_signed_in?
          
                # If the user came from a page, we can send them back.  Otherwise, send
                # them to the root path.
          Severity: Minor
          Found in app/controllers/application_controller.rb - About 25 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