Showing 1,896 of 2,859 total issues
Function parserOnIncoming
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parserOnIncoming(req, shouldKeepAlive) {
incoming.push(req);
// If the writable end isn't consuming, then stop reading
// so that we don't become overwhelmed by a flood of
Method call
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def call(env)
path = env['PATH_INFO'] || env['REQUEST_URI']
commands = path.split('/')
@count += 1
Function __init__
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, arch, mode, shell_dir, mode_flags, verbose, timeout,
Function list
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Interface.prototype.list = function(delta) {
if (!this.requireConnection()) return;
delta || (delta = 5);
Function _createServerHandle
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function(address, port, addressType, fd) {
var err = 0;
// assign handle in listen, and clean up if bind or listen fails
var handle;
Function fromList
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function fromList(n, state) {
var list = state.buffer;
var length = state.length;
var stringMode = !!state.decoder;
var objectMode = !!state.objectMode;
Function breakCommandToJSONRequest_
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
DebugRequest.prototype.breakCommandToJSONRequest_ = function(args) {
// Build a evaluate request from the text command.
// Process arguments if any.
if (args && args.length > 0) {
var target = args;
Function end
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
OutgoingMessage.prototype.end = function(data, encoding, callback) {
if (util.isFunction(data)) {
callback = data;
data = null;
} else if (util.isFunction(encoding)) {
Function stepCommandToJSONRequest_
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
DebugRequest.prototype.stepCommandToJSONRequest_ = function(args, type) {
// Requesting a step is through the continue command with additional
// arguments.
var request = this.createRequest('continue');
request.arguments = {};
Function bnpDivRemTo
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function bnpDivRemTo(m,q,r) {
var pm = m.abs();
if(pm.t <= 0) return;
var pt = this.abs();
if(pt.t < pm.t) {
Function lookup
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.lookup = function lookup(hostname, options, callback) {
var hints = 0;
var family = -1;
// Parse arguments
Function wrap
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Readable.prototype.wrap = function(stream) {
var state = this._readableState;
var paused = false;
var self = this;
Function cb
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function cb (er, data) {
var s = npm.config.get('save')
, d = npm.config.get('save-dev')
, o = npm.config.get('save-optional')
if (er || !(s || d || o)) return cb_(er, data)
Function edit
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function edit (cb) {
var e = npm.config.get("editor")
, which = npm.config.get("global") ? "global" : "user"
, f = npm.config.get(which + "config")
if (!e) return cb(new Error("No EDITOR config or environ set."))
Function GetLdflags
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def GetLdflags(self, config, gyp_to_build_path, expand_special,
manifest_base_name, output_name, is_executable, build_dir):
"""Returns the flags that need to be added to link commands, and the
manifest files."""
config = self._TargetConfig(config)
Function spawnSync
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function spawnSync(/*file, args, options*/) {
var opts = normalizeSpawnArguments.apply(null, arguments);
var options = opts.options;
Function setupMaster
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
cluster.setupMaster = function(options) {
var settings = {
args: process.argv.slice(2),
exec: process.argv[1],
execArgv: process.execArgv,
Function readSharp
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function readSharp() {
var c = port.readChar();
if (isWhitespace(c))
return new sc_Token(13/*ERROR*/, "bad #-pattern0.");
Function help
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function help (args, cb) {
npm.spinner.stop()
var argv = npm.config.get("argv").cooked
var argnum = 0
Function _onResponse
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
Client.prototype._onResponse = function(res) {
var cb,
index = -1;
this._reqCallbacks.some(function(fn, i) {
- 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"