Showing 8 of 30 total issues
File bootstrap.js
has 1412 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* ===================================================
* bootstrap-transition.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#transitions
* ===================================================
* Copyright 2012 Twitter, Inc.
Class User
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
Function show
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, show: function () {
var $tip
, inside
, pos
, actualWidth
Method query
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def query
message = parse_xml_to_hash(params[:xml])
case message.content
when '1'
books = Book.order("RANDOM()").limit(5)
Function slide
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, slide: function (type, next) {
var $active = this.$element.find('.item.active')
, $next = next || $active[type]()
, isCycling = this.interval
, direction = type == 'next' ? 'left' : 'right'
Function showBooks
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var showBooks = function (json) {
$('.books').empty().append('<p>共<b>' + json.count + '</b>条结果</p>');
var books = json.books;
books = $.isArray(books) ? books : books.toArray()
for (var i = 0; i < books.length; i++) {
Function show
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, show: function () {
var that = this
, e = $.Event('show')
this.$element.trigger(e)
Method storeBooks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def storeBooks(json, user)
collections = json['collections']
collections.each { |collection, index|
book = collection['book']
if book['isbn13'] != nil
- Read upRead up
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"