angelakuo/citydogshare

View on GitHub

Showing 3,976 of 3,976 total issues

Assignment Branch Condition size for delete_checked_pictures is too high. [16.97/15]
Open

  def delete_checked_pictures
    activated_ids = params[:activated].collect {|id| id.to_i} if params[:activated]
    seen_ids = params[:seen].collect {|id| id.to_i} if params[:seen]

    if activated_ids
Severity: Minor
Found in app/controllers/dogs_controller.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method has too many lines. [11/10]
Open

  def all_info
    filtered_dogs_hash = Dog.all.select { |dog|
      valid_dog = true
      if params[:available] == "true" && !dog.available then valid_dog = false end
      if params[:available] == "false" && dog.available then valid_dog = false end
Severity: Minor
Found in app/controllers/dogs_controller.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [11/10]
Open

  def create
    @event = Event.new(params_hash)
    @event.dogs << params["event"]["dogs"].map { |id| Dog.where(:id => id) }
    @event.user_id = @current_user.id
    @user = @current_user

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [11/10]
Open

  def initialize(current_user, ip_zipcode, index)
    @values = {}
    @values[:mix] = index ? "All Mixes" : []
    @values[:gender] = []
    @values[:age] = []
Severity: Minor
Found in app/controllers/dog_form_filler.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [11/10]
Open

    def change
        add_column :users, :last_name, :string
        add_column :users, :first_name, :string
        add_column :users, :location, :string
        add_column :users, :gender, :string

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

    val: function( value ) {
        var hooks, ret, isFunction,
            elem = this[ 0 ];

        if ( !arguments.length ) {

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

        data: function( key, value ) {
            var i, name, data,
                elem = this[ 0 ],
                attrs = elem && elem.attributes;
    
    

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

          val: function( value ) {
              var hooks, ret, isFunction,
                  elem = this[ 0 ];
      
              if ( !arguments.length ) {

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

        function addCombinator( matcher, combinator, base ) {
            var dir = combinator.dir,
                skip = combinator.next,
                key = skip || dir,
                checkNonElements = base && key === "parentNode",

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

                      open: function( dontGiveFocus ) {
          
                          // If it’s already open, do nothing.
                          if ( STATE.open ) return P
          
          

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

                    var _slide = function(params, complete, fade, door) {
            
                        var easing = this.getOptions('easing'),
                            distance = this.getStageWidth(),
                            from = { left: distance * ( params.rewind ? -1 : 1 ) },

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

                          open: function( dontGiveFocus ) {
              
                              // If it’s already open, do nothing.
                              if ( STATE.open ) return P
              
              

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

                    function testOptions ( options ) {
                
                        var parsed = {
                            margin: 0,
                            limit: 0,

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

                              open: function( dontGiveFocus ) {
                  
                                  // If it’s already open, do nothing.
                                  if ( STATE.open ) return P
                  
                  

                    Function MockDate has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                    getJasmineRequireObj().MockDate = function() {
                      function MockDate(global) {
                        var self = this;
                        var currentTime = 0;
                    
                    

                    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 ExceptionFormatter has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                    getJasmineRequireObj().ExceptionFormatter = function() {
                      function ExceptionFormatter() {
                        this.message = function(error) {
                          var message = '';
                    
                    

                    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 showHide has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function showHide( elements, show ) {
                        var display, elem, hidden,
                            values = [],
                            index = 0,
                            length = elements.length;

                      Function position has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          position: function() {
                              var options = this.options;
                              var origin = this.el.offsetParent().offset();
                              var width = this.el.outerWidth();
                              var height = this.el.outerHeight();

                        Function lineToken has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            Lexer.prototype.lineToken = function() {
                              var diff, indent, match, noNewlines, size;
                              if (!(match = MULTI_DENT.exec(this.chunk))) {
                                return 0;
                              }

                          Function computeStyleTests has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function computeStyleTests() {
                                  var contents, divStyle,
                                      documentElement = document.documentElement;
                          
                                  // Setup
                            Severity
                            Category
                            Status
                            Source
                            Language