Showing 566 of 915 total issues
Function WallService
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function WallService($q, $http, AppSettings) {
var service = {};
service.getData = function (term) {
var deferred = $q.defer();
Function getVideoLinks
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getVideoLinks(video, whitelistRecord) {
var players = [{
href: video.url || video,
type: CONFIG.T.maybe_text_html,
Function getMeta
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
getMeta: function(meta) {
function getAttr(attr) {
var root = meta.dc || meta.dcterms, key;
Function getLink
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
getLink: function (oembed) {
var $container = $('<div>');
try {
$container.html(oembed.html);
} catch(ex) {}
Function windowMessaging
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var windowMessaging = function(){
return {
postMessage : function(message, target_url, target) {
Function windowMessaging
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var windowMessaging = function(){
return {
postMessage : function(message, target_url, target) {
Function windowMessaging
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var windowMessaging = function(){
return {
postMessage : function(message, target_url, target) {
Function finish
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
finish = function() {
// Abort request.
if (context.htmlparser && context.htmlparser.request) {
context.htmlparser.request.abort();
Function extractDomainPatterns
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function extractDomainPatterns(uri, disableWildcard) {
var patterns = [];
var domain = extractDomain(uri);
Consider simplifying this complex logical expression. Open
if (session && 'access_token' in session && session.access_token && 'expires' in session && session.expires > ((new Date()).getTime() / 1e3)) {
// What is different about the scopes in the session vs the scopes in the new login?
var diff = utils.diff((session.scope || '').split(SCOPE_SPLIT), (p.qs.state.scope || '').split(SCOPE_SPLIT));
if (diff.length === 0) {
Consider simplifying this complex logical expression. Open
if (obj === null || typeof (obj) !== 'object' || obj instanceof Date || 'nodeName' in obj || this.isBinary(obj) || (typeof FormData === 'function' && obj instanceof FormData)) {
return obj;
}
Consider simplifying this complex logical expression. Open
if (clearTimeout(this._holdTimeout),
o.DomEvent.off(e, "touchmove", this._onMove, this).off(e, "touchend", this._onUp, this),
this._fireClick && t && t.changedTouches) {
var i = t.changedTouches[0]
, n = i.target;
Consider simplifying this complex logical expression. Open
if (e = e === i ? this._zoom : this._limitZoom(e),
t = this._limitCenter(o.latLng(t), e, this.options.maxBounds),
n = n || {},
this._panAnim && this._panAnim.stop(),
this._loaded && !n.reset && n !== !0) {
Consider simplifying this complex logical expression. Open
if (h && (force || h != height || !height || !w || !width || w > width)) {
height = h;
width = w;
windowMessaging.postMessage({
windowId: windowId,
Function runPluginsIteration
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function runPluginsIteration(requiredPlugins, context, pluginsUrlMatches, usedMethods, usedParams, usedDomains, options, asyncMethodCb) {
Function qs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
qs: function(url, params, formatFunction) {
if (params) {
// Set default formatting function
- 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 popup
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
popup: function(url, redirectUri, options) {
var documentElement = document.documentElement;
// Multi Screen Popup Positioning (http://stackoverflow.com/a/16861050)
- 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 z
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
router.put('/:user/:app/:id', isAuthorized, function z(req, res) {
getData(req.params.user, function (error, response, body) {
var responseData = JSON.parse(response.body),
appData = responseData.accounts[0].apps,
authData = {},
- 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 9 (exceeds 5 allowed). Consider refactoring. 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
- 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 getLink
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
getLink: function(oembed, options) {
var $container = $('<div>');
try {
$container.html(oembed.html);
- 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"