Showing 15 of 46 total issues
File bootstrap.js
has 1251 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* ===================================================
* bootstrap-transition.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#transitions
* ===================================================
* Copyright 2012 Twitter, Inc.
File spec.rb
has 432 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative 'spec_helper'
describe 'Black Girls Code Website Publisher', :js => true do
it 'publishes my website and show me info bar with site address' do
Class Page
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
class Page
include MongoMapper::Document
key :name, String
key :middle_initial, String
Method upload_page_and_assert_data_was_saved
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def upload_page_and_assert_data_was_saved(params, success = true)
visit '/'
fill_in 'name', :with => params[:name] if params[:name]
fill_in 'middle_initial', :with => params[:middle_initial] if params[:middle_initial]
fill_in 'last_name', :with => params[:last_name] if params[:last_name]
- 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"
Further reading
Function bindEvents
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bindEvents(eventDiv) {
pageCounter(eventDiv);
eventDiv.find('.event-expand').click(function (event) {
event.preventDefault();
File list.js
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
$(function () {
$('.delete').click(function (e) {
var ok = confirm("Are you sure you want to delete that page?");
if (ok) {
$(e.target).closest('form').submit();
File model.rb
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'open-uri'
class Page
include MongoMapper::Document
Method upload_page_and_assert_data_was_saved
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def upload_page_and_assert_data_was_saved(params, success = true)
visit '/'
fill_in 'name', :with => params[:name] if params[:name]
fill_in 'middle_initial', :with => params[:middle_initial] if params[:middle_initial]
fill_in 'last_name', :with => params[:last_name] if params[:last_name]
Function show
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
, show: function () {
var $tip
, inside
, pos
, actualWidth
Function slide
has 36 lines of code (exceeds 25 allowed). Consider refactoring. 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 show
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
, show: function () {
var that = this
, e = $.Event('show')
this.$element.trigger(e)
Method publish!
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.publish!(name, middle_initial, last_name, event, enable_comments, content)
Method redirect_home_with_input
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def redirect_home_with_input(name, middle_initial, last_name, event)
redirect "/?#{name.blank? ? '' : '&name=' + name }#{middle_initial.blank? ? '' : '&middle_initial=' + middle_initial }#{last_name.blank? ? '' : '&last_name=' + last_name }#{event.blank? ? '' : '&event=' + event }"
end
- 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"
Further reading
Method publish!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.publish!(name, middle_initial, last_name, event, enable_comments, content)
return if invalid_page?(name, content)
page_data = {name: name, middle_initial: middle_initial, last_name: last_name, event: event, :content => content, :enable_comments => enable_comments == 'on'}
- 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"
Further reading
Method content_from
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def content_from(params)
link = params[:link]
page = params[:page]
html = params[:html]
return content_from_link(link) unless link.blank?
- 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"