Showing 11 of 23 total issues
Function cApp
has 260 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.cApp = (function () {
'use strict';
$(window).on('load', function () {
cApp.LazyLoad.css();
Function cApp
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
Open
window.cApp = (function () {
'use strict';
$(window).on('load', function () {
cApp.LazyLoad.css();
- 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 generateMarkup
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var generateMarkup = function (repo) {
var $placeholder = $('<div/>').css('display', 'none');
$(target).append($placeholder);
var trackGenerate = app.Tracking.start('GitHub render ' + repo.full_name, 'github');
File app.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
window.cApp = (function () {
'use strict';
$(window).on('load', function () {
cApp.LazyLoad.css();
Function success
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
success: function (html) {
trackGenerate.done();
var $content = $(html);
$placeholder.replaceWith($content);
Function loadProjects
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var loadProjects = function () {
if($(target).data('loaded')) {
return;
} else {
$(target).data('loaded', 'true');
Function loadProjects
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var loadProjects = function () {
if($(target).data('loaded')) {
return;
} else {
$(target).data('loaded', 'true');
Function goToTab
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
goToTab: function (tabId) {
var $currentLink = $('a.mdl-layout__tab.is-active');
var $targetLink = $('#tab-' + tabId);
var currentId = $currentLink.attr('id').replace('tab-', '');
Function gestureDetector
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
gestureDetector: function (ev) {
if (!this.isTouchDevice_) {
return;
}
Function setupFab
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setupFab: function () {
var $button = $('.specs-fab-menu');
var $footer = $('footer');
cApp.Scroll.listeners_.push(function () {
Function generateTags
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var generateTags = function (repoFullName, containerId) {
var trackTags = app.Tracking.start('Docker Hub tags ' + repoFullName, 'dockerhub');
$.get({
url: baseUrl + '/repositories/' + repoFullName + '/tags',