Showing 566 of 915 total issues
Function wrapContainer
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wrapContainer($element, data) {
var media = data.media;
if (media && media.height && media.width && !media["aspect-ratio"]) {
Function getData
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
getData: function(url, options, cb) {
var request;
getUrl(url, _.extend({}, options, {
Function logout
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
logout: function() {
var _this = this;
var utils = _this.utils;
var error = utils.error;
Function parseMetaLinks
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseMetaLinks: function(key, value, whitelistRecord) {
if (typeof value !== "object" || typeof value === "string") {
return [];
}
Function sortLinks
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
core.sortLinks = function(links) {
// Sort links in order of REL according to CONFIG.REL_GROUPS.
function getRelIndex(rel) {
var rels = _.intersection(rel, CONFIG.REL_GROUPS);
Function getLink
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
getLink: function(sm4, whitelistRecord) {
if (!(sm4.video && sm4.video.embed && whitelistRecord.isAllowed && whitelistRecord.isAllowed('sm4.video'))) {
return;
}
- 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 prepareLink
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
prepareLink: function(link) {
if (link.type === CONFIG.T.image) {
var extRe = link.href.match(/\.(\w{3,4})(\?.*)?$/);
- 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 lookupStaticProviders
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function lookupStaticProviders(uri) {
var providers = require('./providers.json');
var protocolMatch = uri.match(/^(https?:\/\/)/);
if (!protocolMatch) {
- 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 isYoutube
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function isYoutube(meta) {
var video;
if (meta.og && (video = meta.og.video)) {
if (!(video instanceof Array)) {
- 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 link
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope) {
var hello = scope.hello;
var isOnline = hello('twitter').getAuthResponse();
var idleTime = 0;
Function sortLinksInner
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sortLinksInner(l1, l2) {
var non_responsive_1 = l1.media && l1.media['width'] && l1.media['height'];
var non_responsive_2 = l2.media && l2.media['width'] && l2.media['height'];
if (non_responsive_1 && !non_responsive_2) {
Function xmlStream2oembed
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xmlStream2oembed(stream, callback) {
var oembed;
var prop;
var value;
var firstTag;
Function prepareLink
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
prepareLink: function(url, link, options, cb) {
// Check if need link processing.
function finish() {
Function update2
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
vm.update2 = function(refreshTime) {
return $timeout(function() {
SearchService.initData(searchParams).then(function(data) {
if (data.statuses) {
if (data.statuses.length <= 0) {
Function _handleMatchSelection
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _handleMatchSelection(key){
var caretPosition = _getCaretPosition($select.searchInput[0]),
length = $select.selected.length,
// none = -1,
first = 0,
Function customHandler
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function customHandler(req, res, next) {
// Check that this is a login redirect with an access_token (not a RESTful API call via proxy)
if (req.oauthshim &&
req.oauthshim.redirect &&
Function OnRun
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function OnRun($rootScope, AppSettings, HelloService) {
var root = {};
root.hello = HelloService;
/**
Consider simplifying this complex logical expression. Open
else if (window.Element) {
return data instanceof window.Element && (!type || (data.tagName && data.tagName.toLowerCase() === type));
}
else {
return (!(data instanceof Object || data instanceof Array || data instanceof String || data instanceof Number) && data.tagName && data.tagName.toLowerCase() === type);
Consider simplifying this complex logical expression. Open
if ((meta.twitter && meta.twitter.card == 'player') || (meta.og && meta.og.type == 'video') || meta.video_src || (href && /video\.html$/.test(href))) {
var aspect = oembed.height ? oembed.width / oembed.height : 0;
// This is to fix incorrect aspect for both iFrame and images :\
Consider simplifying this complex logical expression. Open
if (data.response && data.response.length > 0) {
var status = data.response[0];
var m = url.match(/hash=([\w-]+)/i);