Showing 59 of 111 total issues
Function computePlacementCoords
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function computePlacementCoords(element, placement, tipWidth, tipHeight, offset) {
var placementBase = placement.split('-')[0], // ignore 'alt' for corners
coords = new CSSCoordinates(),
position;
Function navigation
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function navigation() {
var $mainNavContainer = $('#main-navigation-container');
var lang = $('html').attr('lang') || 'en-US';
var $expandedNavTriggers = $('.navbar-toggle');
Function resultsCallback
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function resultsCallback(err, data, total) {
var isStickySearch = (searchOptions.tagPrefix === options.stickyPrefix),
itemString = '',
frag = document.createElement('div'),
makerID = $('meta[name=\'maker-id\']').attr('content'),
Function addCSP
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports.addCSP = function (options) {
return hood.csp({
headers: [
'Content-Security-Policy-Report-Only'
],
Function getSvgPlacement
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getSvgPlacement(element, placement) {
var svgElement = element.closest('svg')[0],
domElement = element[0],
point = svgElement.createSVGPoint(),
boundingBox = domElement.getBBox(),
Function powerTip
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.powerTip = function(opts, arg) {
// don't do any work if there were no matched elements
if (!this.length) {
return this;
}
Function permissionsModel
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var permissionsModel = function (options) {
var permissions = {
'webmaker-super-mentor': {
'issue': 3,
'applications': 3,
Function link
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function ($scope, $element, $attrs) {
var options = [];
var lang;
for (var i = 0; i < config.supported_languages.length; i++) {
lang = config.supported_languages[i];
Function pagination
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
UI.pagination = function (page, total, limit, callback) {
var $pagination = $('.pagination'),
$ul = $pagination.find('ul'),
$li = $('<li></li>'),
$pageBtn,
Function select
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
UI.select = function (select, fn) {
$('.filter').removeClass('hide');
var $el = $('.ui-select', $fragments).clone(true),
$toggleBtn = $el.find('.icon'),
Function onboardingExperience
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onboardingExperience() {
$('#home-start-form').on('submit', function () {
$rootScope.joinWebmaker($('.home-email-field').val(), '', $('#onboarding-checkbox').prop('checked'));
});
var input = $('.onboarding-input');
Function getHtmlPlacement
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getHtmlPlacement(element, placement) {
var objectOffset = element.offset(),
objectWidth = element.outerWidth(),
objectHeight = element.outerHeight(),
left,
Function SocialMedia
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function SocialMedia( options ) {
var urlPlaceHolder = options.url || "__URL__PLACE__HOLDER__";
/**
* The various social media all have the same API.
Function process
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
makeClient.process = function (callback, id) {
makeClient.then(function (err, data, totalHits) {
if (err) {
return callback(err);
}
Function exports
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function (req, res) {
var make = require('../lib/makeapi').readOnly,
querystring = require('querystring');
var DEFAULT_TYPE = 'tags',
- 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 showTip
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function showTip(element) {
var tipContent;
// it is possible, especially with keyboard navigation, to move on to
// another element with a tooltip during the queue to get to this point
Function exports
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (req, res) {
var make = require('../lib/makeapi').authenticated,
username = req.session.user ? req.session.user.username : '',
page = req.query.page || 1,
app = req.query.app,
Function exports
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (options) {
return function (req, res, next) {
var DEFAULT_LAYOUT = 'index',
DEFAULT_LIMIT = 12,
layouts = {
Function exports
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function (options) {
return function (req, res, next) {
var DEFAULT_PREFIX = 'p',
DEFAULT_LAYOUT = 'index',
DEFAULT_STICKY_LIMIT = 24, // Larger to account for possible duplicates
- 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 likeClickCallback
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function likeClickCallback(e) {
e.preventDefault();
e.stopPropagation();
var $this = $(this),
makeID = $this.data('make-id'),