Showing 12 of 14 total issues
File advanced_and_extended.js
has 617 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Full HTML5 compatibility rule set
* Loosened and extended ruleset. Allows more freedom on user side
* These rules define which tags and CSS classes are supported and which tags should be specially treated.
*/
File to-markdown.js
has 558 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.toMarkdown = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/*
* to-markdown - an HTML to Markdown converter
*
* Copyright 2011-15, Dom Christie
Function 1
has 195 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.toMarkdown = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/*
* to-markdown - an HTML to Markdown converter
*
* Copyright 2011-15, Dom Christie
Function 3
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{}],3:[function(require,module,exports){
'use strict';
module.exports = [
{
Function 2
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"./lib/gfm-converters":2,"./lib/md-converters":3,"collapse-whitespace":4,"jsdom":7}],2:[function(require,module,exports){
'use strict';
function cell(content, node) {
var index = Array.prototype.indexOf.call(node.parentNode.childNodes, node);
Function 4
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{}],4:[function(require,module,exports){
'use strict';
var voidElements = require('void-elements');
Object.keys(voidElements).forEach(function (name) {
Function collapseWhitespace
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function collapseWhitespace(elem, isBlock) {
if (!elem.firstChild || elem.nodeName === 'PRE') return;
if (typeof isBlock !== 'function') {
isBlock = isBlockElem;
Function 5
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"block-elements":5,"void-elements":6}],5:[function(require,module,exports){
/**
* This file automatically generated from `build.js`.
* Do not manually edit.
*/
Method initialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize
@layout = "application"
@blog_title = "Blog"
@blog_description = "A list of posts about a topic"
@disqus_name = nil
Avoid deeply nested control flow statements. Open
Open
if (prevText) {
prevText.data = prevText.data.replace(/ $/, '');
}
Avoid deeply nested control flow statements. Open
Open
} else if (isVoid(node)) {
// Avoid trimming space around non-block, non-BR void elements.
prevText = null;
prevVoid = true;
}
Method add_posts_to_db
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def add_posts_to_db
parsed_json.each do |post|
puts "Importing #{post['title']}"
post.delete("id")
author_first_name = post["author"]["first_name"]
- 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"