Showing 566 of 915 total issues
Function exports
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(options, callback) {
options = _.extend({}, options);
if (typeof options.prepareResult !== 'function') {
Function a
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function a(i, n) {
if (!i.compiled) {
if (i.compiled = !0,
i.k = i.k || i.bK,
i.k) {
File whitelist.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
(function(whitelist) {
var chokidar = require('chokidar'),
fs = require('fs'),
path = require('path'),
Function getLinks
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getLinks: function(urlMatch, meta, oembed, options) {
var src = 'http://instagram.com/p/' + urlMatch[1] + '/media/?size=';
var aspect = oembed.thumbnail_width && oembed.thumbnail_height ? oembed.thumbnail_width / oembed.thumbnail_height : 1/1
Function getLink
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
getLink: function(urlMatch, request, cb) {
var gistId = urlMatch[2];
var filePermalink = urlMatch[4];
if (!filePermalink) {
- 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 getLinks
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
getLinks: function (meta, oembed, options, cb) {
// When there is no project video, Kikstarter's oEmbed has diff output
// 'meta' param is there to determine if there's a video
// oembed thumbnail is returned as link and not as mixin to avoid empty results and fallback to generic parsers
- 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 Multipart
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Multipart() {
// Internal body
var body = [];
var boundary = (Math.random() * 1e10).toString(32);
Function formatEntry
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function formatEntry(a) {
var group = a.media$group;
var photo = group.media$content.length ? group.media$content[0] : {};
var mediaContent = group.media$content || [];
Function evalHistogram
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function evalHistogram(statistics) {
if (Object.getOwnPropertyNames(statistics.created_at).length !== 0) {
var data = [];
var labels = [];
var chosen_attr = statistics.created_at;
Function getLinks
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getLinks: function(twitter, meta, whitelistRecord) {
var links = [];
if (twitter.card === "gallery") {
Function prepareLink
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
prepareLink: function(url, link, options, cb) {
if (!link.href) {
return cb();
}
Consider simplifying this complex logical expression. Open
Open
if (t.touches && 2 === t.touches.length && this._zooming) {
var i = e.mouseEventToLayerPoint(t.touches[0])
, n = e.mouseEventToLayerPoint(t.touches[1]);
this._scale = i.distanceTo(n) / this._startDist,
this._delta = i._add(n)._divideBy(2)._subtract(this._startCenter),
Consider simplifying this complex logical expression. Open
Open
if (this.options.autoPan) {
var t = this._map
, e = this._container.offsetHeight
, i = this._containerWidth
, n = new o.Point(this._containerLeft,-e - this._containerBottom);
Function findBestSizedLink
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.iframely.findBestSizedLink = function(targetWidth, targetHeight, links) {
var sizedLinks = $.iframely.filterLinks(links, function(link) {
var media = link.media;
return media && media.width && media.height;
Function getUrl
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getUrl = exports.getUrl = function(url, options) {
var req = new events.EventEmitter();
var options = options || {};
Function start
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.start = function() {
//construct term
delete $scope.newWallOptions.link;
var dataParams = encodeURIComponent(angular.toJson($scope.newWallOptions));
$('#wall-modal').modal('toggle');
Function getFullscreenAPI
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ui.getFullscreenAPI = function() {
var dE = document.documentElement,
api,
tF = 'fullscreenchange';
Function jsonp
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jsonp: function(url, callback, callbackID, timeout) {
var _this = this;
var error = _this.error;
Function link
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function(scope, elem, attrs) {
var checkWhenEnabled, handler, scrollDistance, scrollEnabled;
$window = angular.element($window);
scrollDistance = 0;
if (attrs.infiniteScrollDistance != null) {
Function ImportProfileService
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ImportProfileService($q, $http, $rootScope, AppSettings) {
var service = {};
service.search = function(screen_name, source_type, msg_id) {