Showing 2,859 of 2,859 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
def try_unlink(path):
try:
os.unlink(path)
except OSError, e:
if e.errno != errno.ENOENT: raise
- 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 39.
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
def StartPositionAndTypeOffset(self):
return 12 * self.heap.PointerSize() + 5 * self.heap.IntSize()
- 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 39.
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
self.WriteVariableList(ninja_file, 'includes',
[QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor)
- 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 39.
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
self.WriteVariableList(ninja_file, 'resource_includes',
[QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor)
- 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 39.
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
Function _getDisplayPos
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Interface.prototype._getDisplayPos = function(str) {
var offset = 0;
var col = this.columns;
var row = 0;
var code;
Function write
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.write = function(paragraph) {
if (!did_write_anything) {
emitHeader();
did_write_anything = true;
}
Function newSection
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function newSection(tok) {
var section = {};
// infer the type from the text.
var text = section.textRaw = tok.text;
if (text.match(eventExpr)) {
Function normalizeSpawnArguments
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function normalizeSpawnArguments(file /*, args, options*/) {
var args, options;
if (Array.isArray(arguments[1])) {
args = arguments[1].slice(0);
Function pump
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.pump = exports.deprecate(function(readStream, writeStream, callback) {
var callbackCalled = false;
function call(a, b, c) {
if (callback && !callbackCalled) {
Function renegotiate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
TLSSocket.prototype.renegotiate = function(options, callback) {
var requestCert = this._requestCert,
rejectUnauthorized = this._rejectUnauthorized;
if (typeof options.requestCert !== 'undefined')
Function GetCompletions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function GetCompletions(global, last, full) {
var full_tokens = full.split();
full = full_tokens.pop();
var parts = full.split('.');
parts.pop();
Function formatScope_
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function formatScope_(scope) {
var result = '';
var index = scope.index;
result += '#' + (index <= 9 ? '0' : '') + index;
result += ' ';
Function bnToString
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bnToString(b) {
var this_array = this.array;
if(this.s < 0) return "-"+this.negate().toString(b);
var k;
if(b == 16) k = 4;
Function cleanup
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function cleanup (data) {
if (Array.isArray(data)) {
if (data.length === 1) {
data = data[0]
} else {
Function completion
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
runScript.completion = function (opts, cb) {
// see if there's already a package specified.
var argv = opts.conf.argv.remain
Function viewMan
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function viewMan (man, cb) {
var nre = /([0-9]+)$/
var num = man.match(nre)[1]
var section = path.basename(man, "." + num)
Function linkBins
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function linkBins (pkg, folder, parent, gtop, cb) {
if (!pkg.bin || !gtop && path.basename(parent) !== "node_modules") {
return cb()
}
var binRoot = gtop ? npm.globalBin
Function fetchAndShaCheck
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function fetchAndShaCheck (u, tmp, shasum, auth, cb) {
npm.registry.fetch(u, { auth : auth }, function (er, response) {
if (er) {
log.error("fetch failed", u)
return cb(er, response)
Function mirrorRemote
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mirrorRemote (from, cloneURL, treeish, cachedRemote, silent, cb) {
mkdir(cachedRemote, function (er) {
if (er) return cb(er)
var args = [
Function _GenerateMSVSProject
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _GenerateMSVSProject(project, options, version, generator_flags):
"""Generates a .vcproj file. It may create .rules and .user files too.
Arguments:
project: The project object we will generate the file for.