Showing 22 of 43 total issues
File markdown.js
has 1059 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Released under MIT license
// Copyright (c) 2009-2010 Dominic Baggott
// Copyright (c) 2009-2010 Ash Berlin
// Copyright (c) 2011 Christoph Dorn <christoph@christophdorn.com> (http://www.christophdorn.com)
// Date: 2013-09-15T16:12Z
Function lists
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
lists: (function( ) {
// Use a closure to hide a few variables.
var any_list = "[*+-]|\\d+\\.",
bullet_list = /[*+-]/,
// Capture leading indent as it matters for determining nested lists.
Function convert_tree_to_html
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
function convert_tree_to_html( tree, references, options ) {
var i;
options = options || {};
// shallow clone
Method initialize
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(user)
alias_action :post_connect, to: :connect
alias_action :patch_confirm, to: :confirm
# Note: 'archive' is to READ archives
Method initialize
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def initialize(user)
alias_action :post_connect, to: :connect
alias_action :patch_confirm, to: :confirm
# Note: 'archive' is to READ archives
- 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 link
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
"[": function link( text ) {
var orig = String(text);
// Inline content is possible inside `link text`
var res = inline_until_char.call( this, text.substr(1), "]" );
Function table
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Maruku.block.table = function table ( block ) {
var _split_on_unescaped = function( s, ch ) {
ch = ch || '\\s';
if ( ch.match(/^[\\|\[\]{}?*.+^$]$/) )
Method create
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def create
if session[:omniauth].present?
super
session[:omniauth] = nil unless @user.new_record?
else
- 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 strong_em
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function strong_em( tag, md ) {
var state_slot = tag + "_state",
other_slot = tag === "strong" ? "em_state" : "strong_state";
Function blockquote
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
blockquote: function blockquote( block, next ) {
if ( !block.match( /^>/m ) )
return undefined;
var jsonml = [];
Function block_meta
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Maruku.block.block_meta = function block_meta( block ) {
// check if the last line of the block is an meta hash
var m = block.match( /(^|\n) {0,3}\{:\s*((?:\\\}|[^\}])*)\s*\}$/ );
if ( !m )
return undefined;
Function caret
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.caret = function (begin, end) {
if (this.length == 0)
return;
if (typeof begin == 'number') {
Function caret
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
$.fn.caret = function (begin, end) {
if (this.length == 0)
return;
if (typeof begin == 'number') {
- 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
Method initialize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def initialize(data)
@name = data['name']
@realm = data['realm']
if data.key? 'members'
@members = Hash.new
- 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
Method index
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def index
status = params[:status].downcase.to_sym if params[:status].present?
if [:all, :closed].include? status
@status = status
else
- 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
Avoid deeply nested control flow statements. Open
if ( --open_parens === 0) {
consumed -= url.length - len;
url = url.substring(0, len);
}
Avoid deeply nested control flow statements. Open
for ( i = 0; i < stack.length; i++ ) {
if ( stack[ i ].indent !== m[1] )
continue;
list = stack[ i ].list;
Avoid deeply nested control flow statements. Open
if (!found) {
//print("not found. l:", uneval(l));
wanted_depth++;
if ( wanted_depth <= stack.length ) {
stack.splice(wanted_depth, stack.length - wanted_depth);
Method index
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def index
@posts = Post.recently_published.limit(5)
data = REDIS.get "wowprogress"
@wowprogress = JSON.parse(data) if data
if @wowprogress
- 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
Method patch_confirm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def patch_confirm
if current_user.character
if current_user.character.confirmed
flash[:error] = 'You have already confirmed your character.'
redirect_to root_path
- 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"