Showing 2,859 of 2,859 total issues
Function CallLoadTargetBuildFile
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def CallLoadTargetBuildFile(global_flags,
Function Load
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def Load(build_files, variables, includes, depth, generator_input_info, check,
Function ExecLinkWithManifests
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname,
Function ExecMidlWrapper
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl,
Function kill
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
ChildProcess.prototype.kill = function(sig) {
var signal;
if (!constants) {
constants = process.binding('constants');
Function sh_load
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sh_load(language, element, prefix, suffix) {
if (language in sh_requests) {
sh_requests[language].push(element);
return;
}
Function DiffieHellman
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding) {
if (!(this instanceof DiffieHellman))
return new DiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding);
if (!util.isBuffer(sizeOrKey) &&
Function request
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Client.prototype.request = function(method, path, headers) {
var self = this;
var options = {};
options.host = self.host;
options.port = self.port;
Function removeAllListeners
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function removeAllListeners(type) {
var key, listeners;
if (!this._events)
return this;
Function main
has 28 lines of code (exceeds 25 allowed). Consider refactoring. 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 http
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Benchmark.prototype.http = function(p, args, cb) {
var self = this;
var wrk = path.resolve(__dirname, '..', 'tools', 'wrk', 'wrk');
var regexp = /Requests\/sec:[ \t]+([0-9\.]+)/;
var spawn = require('child_process').spawn;
Function main
has 28 lines of code (exceeds 25 allowed). Consider refactoring. 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 init
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init (args, cb) {
var dir = process.cwd()
log.pause()
npm.spinner.stop()
var initFile = npm.config.get("init-module")
Function out
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var out = results.map(function (res) {
var out = res.cmd
, r = Object.keys(res.hits).map(function (k) {
return k + ":" + res.hits[k]
}).sort(function (a, b) {
Function linkMans
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function linkMans (pkg, folder, parent, gtop, cb) {
if (!pkg.man || !gtop || process.platform === "win32") return cb()
var manRoot = path.resolve(npm.config.get("prefix"), "share", "man")
log.verbose("linkMans", "man files are", pkg.man, "in", manRoot)
Function _AddConfigurationToMSVSProject
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config):
"""Adds a configuration to the MSVS project.
Many settings in a vcproj file are specific to a configuration. This
function the main part of the vcproj file that's configuration specific.
Function GenerateOutputForConfig
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def GenerateOutputForConfig(target_list, target_dicts, data,
params, config_to_use):
options = params['options']
generator_flags = params['generator_flags']
Function BuildOptions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def BuildOptions():
result = optparse.OptionParser()
result.add_option("-m", "--mode", help="The test modes in which to run (comma-separated)",
default='release')
result.add_option("-v", "--verbose", help="Verbose output",
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (size === 0) {
// collected the data into the buffers list.
buffer = Buffer.concat(buffers, pos);
} else if (pos < size) {
buffer = buffer.slice(0, pos);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 57.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (size === 0) {
// data was collected into the buffers list.
buffer = Buffer.concat(buffers, pos);
} else if (pos < size) {
buffer = buffer.slice(0, pos);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 57.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76