Showing 527 of 527 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
Repository.prototype.saveAll = function () {
let self = this;
return Promise.all(Object.keys(this._copy).map((key) => self.save(key)));
};
- 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 70.
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 video_return
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function video_return(state, silent) {
var serviceEnd,
serviceStart,
token,
oldPos = state.pos;
Function preview
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Manager.prototype.preview = function (variant, language) {
let self = this;
this
.current
.then(def => self.repository.get('content', def.id))
Function addFile
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addFile (progressContainer, data) {
var fileDiv = document.createElement('div'),
fileFigure = document.createElement('figure'),
fileImg = document.createElement('img'),
fileTitle = document.createElement('p'),
Function jsonSchema
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
static get jsonSchema() {
return {
type: 'object',
required: ['type', 'route'],
properties: {
Function context
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.context = (options, lackeyPath, projectPath, referredPath) => {
try {
let root = projectPath,
Similar blocks of code found in 2 locations. Consider refactoring. Open
gulp.task('lackey.server', function () {
return nodemon({
script: lackeyDIR + '/lib/server/start.js',
exec: 'node --harmony',
ext: 'js yaml json',
- 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 69.
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
gulp.task('lackey.server.dev', function () {
return nodemon({
script: lackeyDIR + '/lib/server/start.js',
exec: 'node --harmony --debug',
ext: 'js yaml json',
- 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 69.
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 constructor
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(HTMLElement, noInput) {
this._listeners = [];
this.node = HTMLElement;
this.attributes = {};
Function inspect
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
inspect(path, templatePath) {
let
structureController,
context,
data,
Function _set
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
KnexStore.prototype._set = function (sid, sess, fn) {
var self = this;
var maxAge = sess.cookie.maxAge;
var now = new Date().getTime();
Function exports
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
.then(ObjectionWrapper => {
class Flyweight extends ObjectionWrapper {
static flightWeightPreload(force) {
Function createElement
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Growl.prototype.createElement = function () {
var self = this,
element = document.createElement('figure'),
opts = {};
Function _postSave
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
_postSave(cached) {
SCli.debug(__MODULE_NAME, '_postSave');
let promise = super._postSave(cached),
Function toHTML
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
toHTML(markdown, parentTag, editMode) {
let marked = new MarkdownIt({
html: true
});
Function exports
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (dust) => {
function format(value, pattern, utc) {
if (value instanceof Date) {
return dateformat(value, pattern, utc);
Function where
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
static where(cursor, query, operand) {
SCli.debug(__MODULE_NAME, 'where', this.model.tableName, JSON.stringify(query), operand);
let self = this,
fn = operand === 'or' ? 'orWhere' : 'where',
Function toYAML
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
toYAML() {
let self = this;
return Content.serializer
.serialize(self.toJSON())
.then((content) => {
Function create
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
static create(User, config, mailer, req, res) {
var create = {},
user;
create.name = req.body.name;
create.email = req.body.email;
Function drawMeta
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawMeta() {
let self = this;
return this.options
.context()