Showing 566 of 915 total issues
Consider simplifying this complex logical expression. Open
if (oembed.type === "video" || oembed.type === "audio"
|| (oembed.type === "rich" && !whitelistRecord.isDefault && whitelistRecord.isAllowed('oembed.rich') && whitelistRecord.isAllowed('oembed.rich', "player")) ) {
return {
media: "player"
};
Consider simplifying this complex logical expression. Open
if (twitter.image && (twitter.image.url || twitter.image.src || (typeof twitter.image === 'string'))) {
links.push({
href: twitter.image.url || twitter.image.src || twitter.image,
type: CONFIG.T.image,
Consider simplifying this complex logical expression. Open
if ((oembed.type === "photo" || oembed.type === "image") && oembed.html && whitelistRecord.isAllowed && whitelistRecord.isAllowed('oembed.photo')) {
var image = {
type: CONFIG.T.text_html, // Always an iframe, either native, or hosted
rel:[CONFIG.R.oembed, CONFIG.R.image, CONFIG.R.html5],
Consider simplifying this complex logical expression. Open
if (player) {
var m = player.media || {};
var width = m.width || m['max-width'] || null;
Consider simplifying this complex logical expression. Open
} else if (params) {
var player = (meta.twitter && meta.twitter.player && meta.twitter.player.value) ||
(meta.og && meta.og.video && meta.og.video.url);
Consider simplifying this complex logical expression. Open
if (parentStyle && iframeStyle &&
parentStyle.match('position: relative;') &&
parentStyle.match('height: 0px;') &&
iframeStyle.match('height: 100%;') &&
iframeStyle.match('width: 100%;')) {
Consider simplifying this complex logical expression. Open
if ((hasGetLinkMethod && getLinkMethodUsed)
|| (r.method.name === 'getData' && r.data.safe_html)
|| (!hasGetLinkMethod && r.method.name === 'getMeta')) {
hasDomainData = true;
}
Consider simplifying this complex logical expression. Open
if (canonical && link.href && typeof link.href === 'string' && link.rel && link.rel.indexOf(CONFIG.R.file) === -1 && link.rel.indexOf(CONFIG.R.iframely) === -1) {
// Remove last / from url.
var link1 = link.href.replace(/\/+$/, '');
Function link
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
link: function (scope, element, attrs, ctrl, transclude) {
Function GoogleChartController
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function GoogleChartController($scope, $element, $attrs, $injector, FormatManager){
Function createPhotoUrl
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function createPhotoUrl(id, farm, server, secret, size) {
Function xhr
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
xhr: function(method, url, headers, data, callback) {
Function Routes
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function Routes($stateProvider, $locationProvider, $urlRouterProvider, $httpProvider, cfpLoadingBarProvider) {
Function _simplifyDPStep
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
_simplifyDPStep: function(t, e, i, n, o) {
Function getBBox
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function getBBox(lat, lon, zoom, width, height) {
Function runMethods
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function runMethods(methods, context, pluginsUrlMatches, options, asyncMethodCb) {
Function jsonp
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
jsonp: function(url, callback, callbackID, timeout) {
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"
Further reading
Function diffKey
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
diffKey: function(a, b) {
if (a || !b) {
var r = {};
for (var x in a) {
// Does the property not exist?
- 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 getData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getData: function(cheerio, __allowBrightcoveInPage) {
/* we are looking for following video on the page, and check that embed is allowed
<video
id="video-js-4306274716001"
- 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 getMeta
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getMeta: function(meta) {
var article = (meta.og && meta.og.article) || meta.article;
var k = article ? article.tag : 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"