tadyjp/rendezvous

View on GitHub

Showing 29 of 37 total issues

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

    Odometer.prototype.addDigit = function(value, repeating) {
      var chr, digit, resetted, _ref;
      if (repeating == null) {
        repeating = true;
      }
Severity: Minor
Found in app/assets/javascripts/lib/odometer.js - About 1 hr to fix

    Function option has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        option: function( key, value ) {
            var options = key,
                parts,
                curOption,
                i;
    Severity: Minor
    Found in app/assets/javascripts/lib/jquery.ui.widget.js - About 1 hr to fix

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

          Odometer.prototype.animateCount = function(newValue) {
            var cur, diff, last, start, tick,
              _this = this;
            if (!(diff = +newValue - this.value)) {
              return;
      Severity: Minor
      Found in app/assets/javascripts/lib/odometer.js - About 1 hr to fix

        Function _createWidget has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _createWidget: function( options, element ) {
                element = $( element || this.defaultElement || this )[ 0 ];
                this.element = $( element );
                this.uuid = uuid++;
                this.eventNamespace = "." + this.widgetName + this.uuid;
        Severity: Minor
        Found in app/assets/javascripts/lib/jquery.ui.widget.js - About 1 hr to fix

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

          def processLine(line):
              if (
                  line.startswith("PRAGMA") or 
                  line.startswith("BEGIN TRANSACTION;") or
                  line.startswith("COMMIT;") or
          Severity: Minor
          Found in bin/sqlite3-to-mysql.py - 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 compose_mail has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

            def compose_mail(post, opts = {})
              fail ArgumentError.new('post missing') unless post.present?
              fail ArgumentError.new('user missing') unless opts[:user].present? && opts[:user].is_a?(User)
              fail ArgumentError.new('to missing') unless opts[:to].present?
              fail ArgumentError.new('to mail format invalid') unless ValidatesEmailFormatOf.validate_email_format(opts[:to]).nil?
          Severity: Minor
          Found in app/controllers/concerns/rv/mailer.rb - 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

          Method file_receiver has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

            def file_receiver
              s3_uploader = S3Uploader.new(bucket: "#{Settings.s3.bucket_name}/1/#{current_user.id}")
          
              s3_files = []
          
          
          Severity: Minor
          Found in app/controllers/apis_controller.rb - 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

          Avoid deeply nested control flow statements.
          Open

                                  if (!paramNameSlice.length) {
                                      paramNameSlice = paramName;
                                  }
          Severity: Major
          Found in app/assets/javascripts/lib/jquery.fileupload.js - About 45 mins to fix

            Method watch! has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              def watch!(hash)
                if hash[:post]
                  watching_posts << hash[:post] unless watching_posts.include?(hash[:post])
                elsif hash[:tag]
                  fail 'Not Implemented.'
            Severity: Minor
            Found in app/models/user.rb - 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

            Severity
            Category
            Status
            Source
            Language