Showing 59 of 111 total issues
Function exports
has 351 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (env) {
// Error messages
var errorHandlers = {
unauthorized: function () {
var err = new Error('You must be logged in to access this area.');
File jquery.powertip.js
has 715 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
PowerTip - v1.2.0 - 2013-04-03
http://stevenbenner.github.com/jquery-powertip/
Copyright (c) 2013 Steven Benner (http://stevenbenner.com/).
Released under MIT license.
File controllers.js
has 614 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
angular
.module('webmakerApp')
.controller('navigationController', ['$scope', '$location', '$routeParams', '$rootScope', 'weblit', 'wmNav', 'CONFIG',
function ($scope, $location, $routeParams, $rootScope, weblit, wmNav, config) {
// Nav data
Function exports
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function (options) {
var moment = require('moment');
var MakeClient = require('makeapi-client');
function generateGravatar(hash) {
- 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 TooltipController
has 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function TooltipController(options) {
var placementCalculator = new PlacementCalculator(),
tipElement = $('#' + options.popupId);
// build and append tooltip div if it does not already exist
Function Gallery
has 174 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Gallery = function (options) {
var self = this;
options = options || {};
options.mainGallery = options.mainGallery || '.main-gallery';
Function PlacementCalculator
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function PlacementCalculator() {
/**
* Compute the CSS position to display a tooltip at the specified placement
* relative to the specified element.
* @private
Function exports
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (grunt) {
require('time-grunt')(grunt);
require('jit-grunt')(grunt, {
shell: 'grunt-shell-spawn',
express: 'grunt-express-server',
File app.js
has 406 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var newrelic;
if (process.env.NEW_RELIC_HOME) {
newrelic = require('newrelic');
} else {
newrelic = {
File badges.js
has 355 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var BadgeClient = require('badgekit-api-client');
var async = require('async');
module.exports = function (env) {
// Error messages
Function exports
has 106 lines of code (exceeds 25 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
Function exports
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (app) {
var redirectMap = [{
// Switch to SSL after Bug 883370 lands.
route: 'http://blog.webmaker.org',
paths: [
Function exports
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (options) {
var moment = require('moment');
var MakeClient = require('makeapi-client');
function generateGravatar(hash) {
Function exports
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (req, res) {
var make = require('../lib/makeapi').readOnly,
querystring = require('querystring');
var DEFAULT_TYPE = 'tags',
Function exports
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function (env) {
// Error messages
var errorHandlers = {
unauthorized: function () {
var err = new Error('You must be logged in to access this area.');
- 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 createMakeClient
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createMakeClient(url, hawk) {
var options = {
apiURL: url
};
if (hawk) {
Function details
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
details: function (req, res, next) {
function getBadge(callback) {
badgeClient.getBadge({
system: env.get('BADGES_SYSTEM'),
badge: req.params.badge
Function exports
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (req, res) {
var MAX_REMIXES = 5;
var make = require('../lib/makeapi').authenticated;
function renderError(message) {
Function DisplayController
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function DisplayController(element, options, tipController) {
var hoverTimer = null;
/**
* Begins the process of showing a tooltip.
File directives.js
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
angular
.module('webmakerApp')
.directive('wmAffix', ['$window', '$timeout',
function ($window, $timeout) {
return {