Showing 54 of 103 total issues
Function _parseExtension
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _parseExtension (ext, name) {
name = name || null;
// If it's a string, the extension was previously loaded
if (showdown.helper.isString(ext)) {
- Create a ticketCreate a ticket
Function extension
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
showdown.extension = function (name, ext) {
'use strict';
if (!showdown.helper.isString(name)) {
throw Error('Extension \'name\' must be a string');
- Read upRead up
- Create a ticketCreate a ticket
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 replaceRecursiveRegExp
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
showdown.helper.replaceRecursiveRegExp = function (str, replacement, left, right, flags) {
'use strict';
if (!showdown.helper.isFunction(replacement)) {
var repStr = replacement;
- Create a ticketCreate a ticket
Function exports
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
config.set({
client: {
captureConsole: true
},
- Create a ticketCreate a ticket
Function rgxFindMatchPos
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
var rgxFindMatchPos = function (str, left, right, flags) {
'use strict';
var f = flags || '',
g = f.indexOf('g') > -1,
x = new RegExp(left + '|' + right, 'g' + f.replace(/g/g, '')),
- Create a ticketCreate a ticket
Function Messenger
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function Messenger (writeMode, supress, mute) {
'use strict';
writeMode = writeMode || 'stderr';
supress = (!!supress || !!mute);
mute = !!mute;
- Read upRead up
- Create a ticketCreate a ticket
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 replaceRecursiveRegExp
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
showdown.helper.replaceRecursiveRegExp = function (str, replacement, left, right, flags) {
'use strict';
if (!showdown.helper.isFunction(replacement)) {
var repStr = replacement;
- Read upRead up
- Create a ticketCreate a ticket
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 Messenger
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Messenger (writeMode, supress, mute) {
'use strict';
writeMode = writeMode || 'stderr';
supress = (!!supress || !!mute);
mute = !!mute;
- Create a ticketCreate a ticket
Function createEvent
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
function createEvent (rgx, evtName, wholeMatch, text, id, url, title, options, globals) {
- Create a ticketCreate a ticket
Function substitutePreCodeTags
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function substitutePreCodeTags (doc) {
var pres = doc.querySelectorAll('pre'),
presPH = [];
- Create a ticketCreate a ticket
Function writeImageTagBaseUrl
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function writeImageTagBaseUrl (wholeMatch, altText, linkId, url, width, height, m5, title) {
- Create a ticketCreate a ticket
Function writeImageTagBase64
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function writeImageTagBase64 (wholeMatch, altText, linkId, url, width, height, m5, title) {
- Create a ticketCreate a ticket
Function writeImageTag
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title) {
- Create a ticketCreate a ticket
Function subParser
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
showdown.subParser = function (name, func) {
'use strict';
if (showdown.helper.isString(name)) {
if (typeof func !== 'undefined') {
parsers[name] = func;
- Read upRead up
- Create a ticketCreate a ticket
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 replaceFunc
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
var replaceFunc = function (wholeMatch, linkId, url, width, height, blankLines, title) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (typeof ext.listeners[ln] !== 'function') {
ret.valid = false;
ret.error = baseMsg + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + ln +
' must be a function but ' + typeof ext.listeners[ln] + ' given';
return ret;
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (!--t) {
end = m.index + m[0].length;
var obj = {
left: {start: start, end: s},
match: {start: s, end: m.index},
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (matches !== null) {
language = matches[1];
break;
}
- Create a ticketCreate a ticket
Function replaceAnchorTagReference
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function replaceAnchorTagReference (rgx, evtRootName, options, globals, emptyCase) {
- Create a ticketCreate a ticket
Function replaceRecursiveRegExp
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
showdown.helper.replaceRecursiveRegExp = function (str, replacement, left, right, flags) {
- Create a ticketCreate a ticket