Showing 54 of 103 total issues
File helpers.js
has 2173 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* showdownjs helper functions
*/
if (!showdown.hasOwnProperty('helper')) {
- Create a ticketCreate a ticket
Function Converter
has a Cognitive Complexity of 151 (exceeds 5 allowed). Consider refactoring. Open
showdown.Converter = function (converterOptions) {
'use strict';
var
/**
- 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 Converter
has 330 lines of code (exceeds 25 allowed). Consider refactoring. Open
showdown.Converter = function (converterOptions) {
'use strict';
var
/**
- Create a ticketCreate a ticket
Function validate
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
function validate (extension, name) {
'use strict';
var errMsg = (name) ? 'Error in ' + name + ' extension->' : 'Error in unnamed extension',
ret = {
- 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 getDefaultOpts
has 182 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getDefaultOpts (simple) {
'use strict';
var defaultOptions = {
omitExtraWLInCodeBlocks: {
- Create a ticketCreate a ticket
Function makehtmlCommand
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
function makehtmlCommand (options, cmd) {
'use strict';
// show configuration options for showdown helper if configHelp was passed
if (options.configHelp) {
- 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
File converter.js
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Created by Estevao on 31-05-2015.
*/
/**
- Create a ticketCreate a ticket
Function makehtmlCommand
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makehtmlCommand (options, cmd) {
'use strict';
// show configuration options for showdown helper if configHelp was passed
if (options.configHelp) {
- Create a ticketCreate a ticket
Function validate
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
function validate (extension, name) {
'use strict';
var errMsg = (name) ? 'Error in ' + name + ' extension->' : 'Error in unnamed extension',
ret = {
- Create a ticketCreate a ticket
Function processListItems
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processListItems (listStr, trimTrailing) {
// The $g_list_level global keeps track of when we're inside a list.
// Each time we enter a list, we increment it; when we leave a list,
// we decrement. If it's zero, we're not in a list anymore.
//
- Create a ticketCreate a ticket
Function rgxFindMatchPos
has a Cognitive Complexity of 22 (exceeds 5 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, '')),
- 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 exports
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
config.set({
// global config of your BrowserStack account
browserStack: {
username: process.env.BROWSERSTACK_USERNAME,
- Create a ticketCreate a ticket
Function makeMarkdown
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.makeMarkdown = function (src) {
// replace \r\n with \n
src = src.replace(/\r\n/g, '\n');
src = src.replace(/\r/g, '\n'); // old macs
- Create a ticketCreate a ticket
Function makeHtml
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.makeHtml = function (text) {
//check if text is not falsy
if (!text) {
return text;
}
- Create a ticketCreate a ticket
Function parseTable
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseTable (rawTable) {
var i, tableLines = rawTable.split('\n');
for (i = 0; i < tableLines.length; ++i) {
// strip wrong first and last column if wrapped tables are used
- Create a ticketCreate a ticket
Function headerId
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function headerId (m) {
var title,
prefix;
// It is separate from other options to allow combining prefix and customized
- Create a ticketCreate a ticket
Function writeImageTag
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title) {
var gUrls = globals.gUrls,
gTitles = globals.gTitles,
gDims = globals.gDimensions;
- Create a ticketCreate a ticket
Function writeAnchorTag
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function writeAnchorTag (evt, options, globals, emptyCase) {
var wholeMatch = evt.getMatches().wholeMatch;
var text = evt.getMatches().text;
var id = evt.getMatches().id;
- Create a ticketCreate a ticket
Function forEach
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
showdown.helper.forEach = function (obj, callback) {
'use strict';
// check if obj is defined
if (showdown.helper.isUndefined(obj)) {
throw new Error('obj param is required');
- 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 Event
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
showdown.helper.Event = function (name, text, params) {
'use strict';
var regexp = params.regexp || null;
var matches = params.matches || {};
- Create a ticketCreate a ticket