Showing 566 of 915 total issues
Function testAll
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
function testAll(cb) {
// Get all plugins with tests.
var pluginsList = _.values(plugins).filter(function(plugin) {
Function cacheMiddleware
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.cacheMiddleware = function(req, res, next) {
async.waterfall([
function(cb) {
Function mergeMediaSize
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
mergeMediaSize: function(links) {
if (links && links instanceof Array) {
// Search first link with media.
- 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 d
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
function d(e, r, i, n) {
function o(e, t) {
for (var r = 0; r < t.c.length; r++)
if (a(t.c[r].bR, e))
return t.c[r]
Function parse
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
GeoJSON.parse = function(objects, params, callback) {
var geomAttrs = [];
// Adds default settings to user-specified params
Function getData
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
getData: function(urlMatch, request, options, cb) {
var api_key = options.getProviderOptions('youtube.api_key');
if (!api_key) {
- 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
File pluginLoader.js
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function(pluginLoader) {
var fs = require('fs'),
path = require('path'),
_ = require('underscore'),
Function args
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
args: function(o, args) {
var p = {};
var i = 0;
var t = null;
- 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 getWhitelistLogData
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
function getWhitelistLogData(meta, oembed) {
var r = {};
if (meta) {
- 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 showEmbeds
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showEmbeds($embeds, data, filterByRel) {
$embeds.html('');
var plugins = [];
Function loadPluginFile
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadPluginFile(pluginPath) {
var bits = pluginPath.split(path.sep);
if (pluginPath.match(/\.js$/i)) {
Function output
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
InlineLexer.prototype.output = function(src) {
var out = ''
, link
, text
, href
Function getPluginsSet
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getPluginsSet(uri, options, usedParams) {
var initialPlugins = [],
usedDomains,
isDomainPluginsMode = false,
Function getData
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
getData: function(urlMatch, request, options, cb) {
var id = urlMatch[1];
var c = options.getProviderOptions("twitter") || options.getProviderOptions("twitter.status");
Function processUrl
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processUrl() {
var uri = $.trim($('.s-uri').focus().val());
if (!uri) {
return;
Function filterLinks
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
exports.filterLinks = function(data, options) {
var links = data.links;
for(var i = 0; i < links.length;) {
- 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
File angular-idle.js
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*** Directives and services for responding to idle users in AngularJS
* @author Mike Grabski <me@mikegrabski.com>
* @version v1.1.0
* @link https://github.com/HackedByChinese/ng-idle.git
* @license MIT
File debug.js
has 339 lines of code (exceeds 250 allowed). Consider refactoring. Open
function linkify(text) {
if (typeof text === "string") {
return text.replace(/((https?:)?\/\/[^"\s]+)/gi, '<a target="_blank" href="$1">$1</a>');
} else {
return text;
Function getLink
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
getLink: function(url) {
// Currently the notes and data layers aren't used in embeds and static maps,
// but who knows, maybe that'll change?
var layers, layer, zoom, lat, lon, bbox, marker, notes = false, data = false;
Function request
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
request: function(p, callback) {
var _this = this;
var error = _this.error;
- 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"