Showing 63 of 84 total issues
Function next
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
next:function () {
if (this.done) {
return this.EOF;
}
if (!this._input) this.done = true;
Function setupOptions
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
setupOptions: function(paramSize, params) {
var options = [], contexts = [], types = [], param, inverse, program;
options.push("hash:" + this.popStack());
Function createFunctionContext
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
createFunctionContext: function(asObject) {
var locals = this.stackVars.concat(this.registers.list);
if(locals.length > 0) {
this.source[1] = this.source[1] + ", " + locals.join(", ");
Function compile
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
compile: function(environment, options, context, asObject) {
this.environment = environment;
this.options = options || {};
log('debug', this.environment.disassemble() + "\n\n");
Function replaceStack
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
replaceStack: function(callback) {
var prefix = '',
inline = this.isInline(),
stack,
createdStack,
Function __module0__
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var __module0__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
"use strict";
var __exports__;
/*globals Handlebars: true */
var Handlebars = __dependency1__;
Function ProgramNode
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
ProgramNode: function(statements, inverseStrip, inverse, locInfo) {
var inverseLocationInfo, firstInverseNode;
if (arguments.length === 3) {
locInfo = inverse;
inverse = null;
Method show
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show
# First look for id=NNN; if we find it it's a simple graveyard path.
if id=params[:id]
if id.to_i > 0
if @graveyard = Graveyard.find(id) rescue nil
Function block
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
block: function(block) {
var mustache = block.mustache,
program = block.program,
inverse = block.inverse;
Function IdNode
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
IdNode: function(parts, locInfo) {
LocationInfo.call(this, locInfo);
this.type = "ID";
var original = "",
Function equals
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
equals: function(other) {
var len = this.opcodes.length;
if (other.opcodes.length !== len) {
return false;
}
Function MarkerWithLabel
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MarkerWithLabel(opt_options) {
opt_options = opt_options || {};
opt_options.labelContent = opt_options.labelContent || "";
opt_options.labelAnchor = opt_options.labelAnchor || new google.maps.Point(0, 0);
opt_options.labelClass = opt_options.labelClass || "markerLabels";
Method default_full_path
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def default_full_path
p = respond_to?(:parent) ? parent : nil
if p && p != self
p.set_default_full_path if p.full_path.blank?
unless p.full_path.blank?
- 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 require_owner_of!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def require_owner_of!(object, user: nil, message: nil)
user ||= current_user
if object.respond_to?(:user_id)
return true if object.user_id == user.id
end
- 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 performAction
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
Function invokePartialWrapper
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {
Avoid deeply nested control flow statements. Open
if (this.terminals_[p] && p > 2) {
expected.push("'" + this.terminals_[p] + "'");
}
Method extract_full_name
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def extract_full_name
n = user_info['name']
return n unless n.blank?
n = user_info['full_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"
Further reading
Avoid deeply nested control flow statements. Open
if(data) {
data.key = key;
data.index = i;
data.first = (i === 0);
}
Function invokePartial
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
__exports__.program = program;function invokePartial(partial, name, context, helpers, partials, data) {