Showing 8 of 8 total issues
Function ImageGallery
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ImageGallery() {
var photoGallery = {
allPhotos: ["IMG0456", "DSC00461", "DSC01000", "DSC01506", "DSC01718", "DSC01723", "DSC01782", "DSC00635", "DSC02794", "DSC02850", "DSC02873", "DSC02879", "DSC02891", "IMG0119", "IMG0131", "IMG0148", "IMG0166", "IMG0170", "DSC00896", "IMG0174", "IMG0179", "IMG0267", "IMG0285", "IMG0363", "IMG0474", "IMG0488", "IMG0529", "IMG0668", "IMG0741"],
sixteen: ["IMG0363", "DSC02794", "DSC02850", "DSC02873", "DSC02879", "DSC02891", "IMG0119", "IMG0131", "IMG0148", "IMG0166", "IMG0170", "IMG0174", "IMG0179", "IMG0267", "IMG0285", "IMG0456", "IMG0474", "IMG0488", "IMG0529", "IMG0668", "IMG0741"],
fifteen: ["DSC00461", "DSC01000", "DSC01506", "DSC01718", "DSC01723", "DSC01782", "DSC00635", "DSC00896"],
Function prototype
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
AxDropdown.prototype = (function() {
var closeAllSelect = function(elmnt) {
/* A function that will close all select boxes in the document,
except the current select box: */
var x, y, i, arrNo = [];
Function prototype
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
AxDropdown.prototype = (function() {
var closeAllSelect = function(elmnt) {
/* A function that will close all select boxes in the document,
except the current select box: */
var x, y, i, arrNo = [];
- 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 init
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function() {
var selected = false,
x = document.getElementsByClassName('ax-select-dropdown'),
i = 0,
j, selElmnt, a, b, c, y;
Function ImageRotator
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ImageRotator() {
var $container = $('.photo-container'),
currentIndex = 0,
$currentCircle = $(".circle.active"),
$nextCircle = $currentCircle.parent().next().children(),
Function validateForm
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
FormValidator.prototype.validateForm = function() {
var inputTypes = [];
var validationType, validator;
var input = $(this.form).find(".validate");
var errorCounterparts = [];
Function ImageGallery
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
function ImageGallery() {
var photoGallery = {
allPhotos: ["IMG0456", "DSC00461", "DSC01000", "DSC01506", "DSC01718", "DSC01723", "DSC01782", "DSC00635", "DSC02794", "DSC02850", "DSC02873", "DSC02879", "DSC02891", "IMG0119", "IMG0131", "IMG0148", "IMG0166", "IMG0170", "DSC00896", "IMG0174", "IMG0179", "IMG0267", "IMG0285", "IMG0363", "IMG0474", "IMG0488", "IMG0529", "IMG0668", "IMG0741"],
sixteen: ["IMG0363", "DSC02794", "DSC02850", "DSC02873", "DSC02879", "DSC02891", "IMG0119", "IMG0131", "IMG0148", "IMG0166", "IMG0170", "IMG0174", "IMG0179", "IMG0267", "IMG0285", "IMG0456", "IMG0474", "IMG0488", "IMG0529", "IMG0668", "IMG0741"],
fifteen: ["DSC00461", "DSC01000", "DSC01506", "DSC01718", "DSC01723", "DSC01782", "DSC00635", "DSC00896"],
- 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
Avoid deeply nested control flow statements. Open
Open
for (k = 0; k < y.length; k++) {
y[k].removeAttribute('class');
}