Showing 13 of 24 total issues
Class Archive
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Archive
include Serializable
def self.from_string(str, uri = nil)
new JSON.parse(str), uri
File harSchema.js
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* See license.txt for terms of usage */
define("preview/harSchema", [], function() {
// ************************************************************************************************
File domplate.js
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
define("domplate/domplate",[],function(){Domplate={};(function(){function DomplateTag(tagName)
{this.tagName=tagName;}
this.DomplateTag=DomplateTag;function DomplateEmbed()
{}
Function compileDOM
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
continue;map[name]=1;var names=name.split(".");blocks.push('var ',names[0]+' = '+'__in__.'+names[0]+';\n');}},compileDOM:function()
{var path=[];var blocks=[];this.domArgs=[];path.embedIndex=0;path.loopIndex=0;path.staticIndex=0;path.renderIndex=0;var nodeCount=this.generateDOM(path,blocks,this.domArgs);var fnBlock=['(function (root, context, o'];for(var i=0;i<path.staticIndex;++i)
fnBlock.push(', ','s'+i);for(var i=0;i<path.renderIndex;++i)
fnBlock.push(', ','d'+i);fnBlock.push(') {\n');for(var i=0;i<path.loopIndex;++i)
fnBlock.push('var l',i,' = 0;\n');for(var i=0;i<path.embedIndex;++i)
Avoid deeply nested control flow statements. Open
{for(var j=0;j<part.format.length;++j)
varName=part.format[j]+'('+varName+')';}
Avoid deeply nested control flow statements. Open
{if(name=="class"&&name in this.attrs)
this.attrs[name]+=" "+val;else
this.attrs[name]=val;}}},compile:function()
Avoid deeply nested control flow statements. Open
{for(var j=0;j<part.format.length;++j)
partName=part.format[j]+"("+partName+")";}
Avoid deeply nested control flow statements. Open
{var className=name.substr(1);if(!this.classes)
this.classes={};this.classes[className]=val;}
Function addParts
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function addParts(val,delim,block,info,escapeIt)
Method entries_before
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def entries_before(time)
raise TypeError, "expected Time" unless time.is_a?(Time)
entries.select do |entry|
next(false) unless entry.time
entry.started_date_time + entry.time / 1000.0 <= time
- 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 validate_if_needed
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_if_needed(hars)
return hars unless @options[:validate]
progress("Validating archives...") {
Array(hars).map { |har|
- 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 entries_before
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def entries_before(time)
raise TypeError, "expected Time" unless time.is_a?(Time)
entries.select do |entry|
next(false) unless entry.time
entry.started_date_time + entry.time / 1000.0 <= time
- 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 by_merging
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.by_merging(hars)
hars = hars.dup
result = hars.shift or raise ArgumentError, "no HARs given"
result = from_file(result) unless result.kind_of? self
- 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"