Showing 566 of 915 total issues
Function getLinks
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getLinks: function(meta, options) {
if (!/bandcamp/i.test(meta.twitter && meta.twitter.site || meta.generator)) {
return;
}
Function getLink
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getLink: function(oembed, options, cb) {
if (oembed.slide_image_baseurl && oembed.slide_image_baseurl_suffix) {
var links = [];
Function getLink
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getLink: function(oembed, options) {
var $container = $('<div>');
try {
$container.html(oembed.html);
Function filterLinks
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.filterLinks = function(data, options) {
var links = data.links;
for(var i = 0; i < links.length;) {
Function callback
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var callback = function(error, data) {
if (timeout) {
clearTimeout(timeout);
timeout = null;
Function lookupStaticProviders
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function lookupStaticProviders(uri) {
var providers = require('./providers.json');
var protocolMatch = uri.match(/^(https?:\/\/)/);
if (!protocolMatch) {
Function day
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
day: function day(unixDate) {
var selectedDate = moment.utc(unixDate);
var startOfMonth = moment.utc(selectedDate).startOf('month');
var previousViewDate = moment.utc(selectedDate).startOf('year');
Function geometryToLayer
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
geometryToLayer: function(t, e, i, n) {
var s, a, r, h, l = "Feature" === t.type ? t.geometry : t, u = l.coordinates, c = [];
switch (i = i || this.coordsToLatLng,
l.type) {
case "Point":
Function prepareResult
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
prepareResult: function(error, response, data, cb) {
if (error) {
return cb(error);
}
Function link
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function(scope, element) {
/**
* Take the embeded link
* Pic.twitter.com is already render in images and is not processed again
* Debug the link with injected service
Function getMeta
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getMeta: function(meta, url) {
// Player.
var has_player = false;
Function getPageData
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.iframely.getPageData = function(uri, options, cb) {
if (typeof options === "function") {
cb = options;
options = {};
Function popup
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
hello.utils.popup = function(url, redirectUri, options) {
// Run the standard
var popup = utilPopup.call(this, url, redirectUri, options);
Function loadPluginTests
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function loadPluginTests(data, cb) {
if (testOnePlugin) {
PluginTest.find({_id: testOnePlugin}, cb);
} else {
Function getUrls
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getUrls(a, cb) {
var tests = plugin.module.tests;
if (!tests) {
Function forEach
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
Array.prototype.forEach = function(fun/*, thisArg*/) {
if (this === void 0 || this === null) {
throw new TypeError();
}
- 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 renderObject
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
$.fn.renderObject = function(o) {
function trimString(v) {
var MAX = 600;
if (typeof v === "string" && v.length > MAX) {
- 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 AppsService
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function AppsService($q, $http, $resource, AppSettings) {
var url = AppSettings.oauthProxyUrl.split('/')[0] + '/' + AppSettings.oauthProxyUrl.split('/')[1] + '/' + AppSettings.oauthProxyUrl.split('/')[2];
return $resource(url + '/:user/:app/:id', {
Function mergeMediaSize
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
mergeMediaSize: function(links) {
if (links && links instanceof Array) {
// Search first link with media.
Function fetchUrlsByPageAndSelector
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.fetchUrlsByPageAndSelector = function(page, selector, options, cb) {
if (typeof options === "function") {
cb = options;
options = {};