Showing 527 of 527 total issues
Function exports
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
.then((ObjectionWrapper) => {
SCli.debug(__MODULE_NAME, 'READY');
class TranslationModel extends Model {
static get tableName() {
Function exports
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
.then((Model, Crud) => {
class Controller extends Crud {
static get model() {
return this._overriden('model', Model);
Function constructor
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(root, options) {
let self = this;
this.page = 1;
this.total = 0;
Similar blocks of code found in 2 locations. Consider refactoring. Open
basePath = (base ? base.getAttribute('href')
.replace(/(.{1})\/$/, '$1') : (loc.protocol + '//' + loc.host + (loc.port && loc.port.length ? (':' + loc.port) : ''))) + '/',
- 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 78.
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
return (basetag ? basetag.getAttribute('href')
.replace(/(.{1})\/$/, '$1') : (loc.protocol + '//' + loc.host + (loc.port && loc.port.length ? (':' + loc.port) : ''))) + '/';
- 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 78.
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
static updateOverlay(block, bounds) {
BlockEditor.updateOverlayBounds(bounds);
if (BlockEditor.activeBlock !== block) {
BlockEditor.overlay.setAttribute('data-target-change', '');
- 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 78.
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
static updateEditButton(block, bounds) {
BlockEditor.updateEditButtonPosition(bounds);
if (BlockEditor.activeBlock !== block) {
BlockEditor.editButton.setAttribute('data-target-change', '');
- 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 78.
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 file
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function file(fileName, schema, dirname) {
console.log(chalk.green('Generationg'), chalk.yellow(fileName));
let number = +schema.$number || 10,
results = [];
Function choice
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Upload.prototype.choice = function (event) {
var self = this,
files1 = Array.prototype.slice.apply(event.target.files || []),
files2 = Array.prototype.slice.apply(event.dataTransfer ? event.dataTransfer.files || [] : []);
Function video_return
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function video_return(state, silent) {
var serviceEnd,
serviceStart,
token,
oldPos = state.pos;
Function exports
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (dust) => {
dust.filters.media = function (value) {
var returnString = '';
if (value.mime === 'video/youtube') {
returnString += '<iframe type="text/html" src="https://www.youtube.com/embed/' + isYoutube(value.source) + '" frameborder="0"></iframe>';
Function exports
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
.then((Model, Crud) => {
class Controller extends Crud {
static get model() {
return this._overriden('model', Model);
Function exports
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (dust) => {
dust.helpers.block = function (chunk, context, bodies, params) {
SCli.debug('lackey-cms/modules/cms/server/lib/dust/block');
Function media
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
dust.filters.media = function (value) {
var returnString = '';
if (value.mime === 'video/youtube') {
returnString += '<iframe type="text/html" src="https://www.youtube.com/embed/' + isYoutube(value.source) + '" frameborder="0"></iframe>';
} else if (value.mime === 'video/vimeo') {
Function set
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
set(media) {
let original = this.original,
position = original ? original.getBoundingClientRect() : {},
paddingTop = this.paddingTop,
Function dictionary
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map(key => {
let value = data.dictionary[key];
if (Array.isArray(value)) {
return {
type: 'select',
Consider simplifying this complex logical expression. Open
if (isNew && ret.length > 0) {
throw(new Error('Identity already exists'));
} else {
return objection.transaction(Identities, function (BoundIdentities) {
return SCli
Function media
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
dust.filters.media = function (value) {
var returnString = '';
if (value.mime === 'video/youtube') {
returnString += '<iframe type="text/html" src="https://www.youtube.com/embed/' + isYoutube(value.source) + '" frameborder="0"></iframe>';
} else if (value.mime === 'video/vimeo') {
Function crawl
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function crawl(data) {
SCli.debug(MODULE_NAME, 'crawl');
if (!data) {
return Promise.resolve(data);
}
Function path
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
dust.helpers.path = function (chunk, context, bodies, params) {
let root = params.root || null,
prefixIfParent = params.prefixIfParent || '',
parent = (params.parent && params.parent.replace(/^\s+|\s+/g).length > 0) ? prefixIfParent + params.parent : null,