Showing 1,896 of 2,859 total issues
Function _ProcessTestPredictable
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def _ProcessTestPredictable(self, test, result, pool):
def HasDifferentAllocations(output1, output2):
def AllocationStr(stdout):
for line in reversed((stdout or "").splitlines()):
if line.startswith("### Allocations = "):
- 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 Done
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def Done(self):
print
for failed in self.runner.failed:
self.PrintFailureHeader(failed)
if failed.output.stderr:
- 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 execute
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Protocol.prototype.execute = function(d) {
var res = this.res;
res.raw += d;
switch (this.state) {
Function memory
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
REPLServer.prototype.memory = function memory(cmd) {
var self = this;
self.lines = self.lines || [];
self.lines.level = self.lines.level || [];
Function connect
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function connect(self, address, port, addressType, localAddress, localPort) {
// TODO return promise from Socket.prototype.connect which
// wraps _connectReq.
assert.ok(self._connecting);
Function getFlatProfile
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Profile.prototype.getFlatProfile = function(opt_label) {
var counters = new CallTree();
var rootLabel = opt_label || CallTree.ROOT_NODE_LABEL;
var precs = {};
precs[rootLabel] = 0;
Function installAndRetest
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function installAndRetest (set, filter, dir, unavoidable, silent, cb) {
//return cb(null, set)
var remove = []
asyncMap(set, function (item, cb) {
Function gyp_main
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def gyp_main(args):
my_name = os.path.basename(sys.argv[0])
parser = RegeneratableOptionParser()
usage = 'usage: %s [options ...] [build_file ...]'
Function _tabComplete
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Interface.prototype._tabComplete = function() {
var self = this;
self.pause();
self.completer(self.line.slice(0, self.cursor), function(err, rv) {
Function ChildProcess
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ChildProcess() {
EventEmitter.call(this);
// Initialize TCPWrap and PipeWrap
process.binding('tcp_wrap');
Function socketOnData
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function socketOnData(d) {
var socket = this;
var req = this._httpMessage;
var parser = this.parser;
Function parseListItem
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parseListItem(item) {
if (item.options) item.options.forEach(parseListItem);
if (!item.textRaw) return;
// the goal here is to find the name, type, default, and optional.
Function _onResponse
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Client.prototype._onResponse = function(res) {
var cb,
index = -1;
this._reqCallbacks.some(function(fn, i) {
Function callback
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function callback(availInAfter, availOutAfter) {
if (self._hadError)
return;
var have = availOutBefore - availOutAfter;
Function main
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function main(conf) {
var api = conf.api;
if (api === 'stream' && process.version.match(/^v0\.[0-8]\./)) {
console.error('Crypto streams not available until v0.10');
// use the legacy, just so that we can compare them.
Function bnModInverse
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function bnModInverse(m) {
var ac = m.isEven();
if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
var u = m.clone(), v = this.clone();
var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
Function RunStep
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
BenchmarkSuite.prototype.RunStep = function(runner) {
this.results = [];
this.runner = runner;
var length = this.benchmarks.length;
var index = 0;
Function run
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function run (pkg, wd, cmd, args, cb) {
if (!pkg.scripts) pkg.scripts = {}
var cmds
if (cmd === "restart" && !pkg.scripts.restart) {
Function outdated
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function outdated (args, silent, cb) {
if (typeof cb !== "function") cb = silent, silent = false
var dir = path.resolve(npm.dir, "..")
// default depth for `outdated` is 0 (cf. `ls`)
Function prettify
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function prettify (tree, installed) {
function red (set, kv) {
set[kv[0]] = kv[1]
return set
}