Showing 5 of 18 total issues
File lightbox.js
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
Lightbox v2.51
by Lokesh Dhakar - http://www.lokeshdhakar.com
Function build
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Lightbox.prototype.build = function() {
var $lightbox,
_this = this;
$("<div>", {
id: 'lightboxOverlay'
Function sizeContainer
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Lightbox.prototype.sizeContainer = function(imageWidth, imageHeight) {
var $container, $lightbox, $outerContainer, containerBottomPadding, containerLeftPadding, containerRightPadding, containerTopPadding, newHeight, newWidth, oldHeight, oldWidth,
_this = this;
$lightbox = $('#lightbox');
$outerContainer = $lightbox.find('.lb-outerContainer');
Function start
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Lightbox.prototype.start = function($link) {
var $lightbox, $window, a, i, imageNumber, left, top, _len, _ref;
$(window).on("resize", this.sizeOverlay);
$('select, object, embed').css({
visibility: "hidden"
Method index
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def index
@foursquare_badges = Rails.cache.fetch('foursquare_badges', expires_in: 12.hours, race_condition_ttl: 10) do
foursquare_connection = Foursquare2::Client.new(client_id: FOURSQUARE_CLIENT_ID,
client_secret: FOURSQUARE_CLIENT_SECRET,
oauth_token: FOURSQUARE_OAUTH_TOKEN,
- 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"