Showing 566 of 915 total issues
Function responseHandler
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
responseHandler: function(window, parent) {
var _this = this;
var p;
var location = window.location;
Function init
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
ui.init = function() {
// extend options
framework.extend(pswp.options, _defaultUIOptions, true);
Function onopentag
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
HTMLMetaHandler.prototype.onopentag = function(name, attributes) {
if (this._end) return;
name = name.toUpperCase();
Function getLinks
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
getLinks: function(meta, options) {
if (!/bandcamp/i.test(meta.twitter && meta.twitter.site || meta.generator)) {
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 scanModulesForPlugins
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
function scanModulesForPlugins() {
// Scan node_modules dir.
var modulesRootPath = path.resolve('node_modules');
var modules_listing = fs.readdirSync(modulesRootPath).map(function(module_name) { return path.resolve(modulesRootPath, module_name); });
Function api
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
hello.api = function() {
// Shorthand
var _this = this;
var utils = _this.utils;
- 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 23 (exceeds 5 allowed). Consider refactoring. Open
getMeta: function(meta) {
function getAttr(attr) {
var root = meta.dc || meta.dcterms, key;
- 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 23 (exceeds 5 allowed). Consider refactoring. Open
getLinks: function(twitter, meta, whitelistRecord) {
var links = [];
if (twitter.card === "gallery") {
- 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 formatManagerFactory
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
function formatManagerFactory(){
// Handles the processing of Google Charts API Formats
function FormatManager(){
var self = this;
var oldFormatTemplates = {};
Function merge
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
function merge(parentObj, props, value) {
/*
Test urls:
http://www.travelchannel.com/video/its-a-real-life-video-game
File views.js
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
var iframelyCore = require('../../lib/core');
var utils = require('../../utils');
var _ = require('underscore');
var async = require('async');
var cache = require('../../lib/cache');
Function calculateTerm
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
function calculateTerm(argument) {
term = "";
var i;
for (i = 0; i < vm.wallOptions.all.length; i++) {
Function FormatManager
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function FormatManager(){
var self = this;
var oldFormatTemplates = {};
self.iFormats = {}; // Holds instances of formats (ie. self.iFormats.date[0] = new google.visualization.DateFormat(params))
self.applyFormats = applyFormats;
Function controller
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: function($scope, $element, $attrs) {
$rootScope.root.haveSearchSuggestion = false;
$rootScope.root.lastSearchTimeStamp = new Date();
$rootScope.root.selectedTermIndex = -1;
$rootScope.root.searchSuggestions = [];
Function _finalMerge
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
HTMLMetaHandler.prototype._finalMerge = function() {
this._end = true;
var that = this;
Function useResult
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function useResult(usedMethods, context, pluginsContexts, allResults, result, options, asyncMethodCb) {
if (!result) {
return false;
}
Function getData
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
getData: function(url, meta, whitelistRecord) {
if (!whitelistRecord.isDefault && ((meta.og && meta.og.image) || (meta.twitter && meta.twitter.image))) {return;}
if (url.match(/^https?:\/\/link\.brightcove\.(?:com|co\.jp)\/services\/player\/bcpid(\d+)\?/i)) {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 getLink
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
getLink: function(schemaVideoObject, whitelistRecord) {
if (schemaVideoObject.embedURL || schemaVideoObject.embedUrl) {
var type = CONFIG.T.maybe_text_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"
Further reading
Function getLinks
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
getLinks: function(gmap, options) {
if (!gmap.mode) {
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 callback
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
function callback(error, data) {
if (!timeout) {
// TODO: log response error after timeout?
return;