Showing 5,951 of 5,951 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
module.exports = CoreView.extend({
initialize: function (options) {
checkAndBuildOpts(options, REQUIRED_OPTS, this);
this._initViews();
- 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 504.
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
Class User
has 148 methods (exceeds 20 allowed). Consider refactoring. Open
class User < Sequel::Model
include CartoDB::MiniSequel
include CartoDB::UserDecorator
include CartodbCentralSynchronizable
include CartoDB::ConfigUtils
File user.rb
has 1094 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'cartodb/per_request_sequel_cache'
require 'cartodb-common'
require 'email_address'
require 'securerandom'
require_relative './user/user_decorator'
Class Visualization
has 136 methods (exceeds 20 allowed). Consider refactoring. Open
class Carto::Visualization < ActiveRecord::Base
include CacheHelper
include Carto::UUIDHelper
include Carto::AuthTokenGenerator
include Carto::VisualizationDependencies
Function exports
has a Cognitive Complexity of 127 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(CodeMirror) {
"use strict";
CodeMirror.defineMode("sql", function(config, parserConfig) {
"use strict";
- 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"
Further reading
File common_passwords.rb
has 1004 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Carto
module CommonPasswords
COMMON_PASSWORDS = ['123456',
'password',
'12345678',
exports
has 123 functions (exceeds 20 allowed). Consider refactoring. Open
module.exports = CoreView.extend({
options: {
// render the chart once the width is set as default, provide false value for this prop to disable this behavior
// e.g. for "mini" histogram behavior
showOnWidthChange: true,
File maki_icons.js
has 949 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Maki icons from https://github.com/mapbox/maki
// and https://github.com/mapbox/maki/blob/mb-pages/_includes/maki.json
module.exports = {
disclaimer: '<a href="https://github.com/mapbox/maki" target="_blank">Maki Icons</a>, an open source project by <a href="http://mapbox.com" target="_blank">Mapbox</a>',
icons: [
Class Table
has 120 methods (exceeds 20 allowed). Consider refactoring. Open
class Table
extend Forwardable
include Carto::TableUtils
include ::LoggerHelper
File maki-icons.js
has 941 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Maki icons from https://github.com/mapbox/maki
// and https://github.com/mapbox/maki/blob/mb-pages/_includes/maki.json
module.exports = {
disclaimer: _t('assets.maki-icons.disclaimer'),
icons: [
File data_import.rb
has 927 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'sequel'
require 'fileutils'
require_relative './user'
require_relative './table'
require_relative './visualization/member'
Class DBService
has 111 methods (exceeds 20 allowed). Consider refactoring. Open
class DBService
include CartoDB::MiniSequel
include Carto::Configuration
include ::LoggerHelper
extend CartoDB::SequelConnectionHelper
Identical blocks of code found in 2 locations. Consider refactoring. Open
render: function() {
var title = this.options.fileAttrs.title && this.model.get('value')[this.options.fileAttrs.title] || this.model.get('value');
var description = this._genDescription();
var ext = this.options.fileAttrs.ext ? Utils.getFileExtension(title) : '' ;
- 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 368.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
render: function() {
var title = this.options.fileAttrs.title && this.model.get('value')[this.options.fileAttrs.title] || this.model.get('value');
var description = this._genDescription();
var ext = this.options.fileAttrs.ext ? Utils.getFileExtension(title) : '' ;
- 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 368.
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
File table.js
has 834 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* models for cartodb admin
*/
(function() {
Similar blocks of code found in 2 locations. Consider refactoring. Open
module.exports = {
icons: [
{ kind: "pattern", ext: "png", name: 'diagonal_1px_fast', icon: 'diagonal_1px_fast'},
{ kind: "pattern", ext: "png", name: 'diagonal_1px_med', icon: 'diagonal_1px_med', },
{ kind: "pattern", ext: "png", name: 'diagonal_1px_slow', icon: 'diagonal_1px_slow'},
- 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 348.
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
module.exports = {
icons: [
{ kind: 'pattern', ext: 'png', name: 'diagonal_1px_fast', icon: 'diagonal_1px_fast' },
{ kind: 'pattern', ext: 'png', name: 'diagonal_1px_med', icon: 'diagonal_1px_med' },
{ kind: 'pattern', ext: 'png', name: 'diagonal_1px_slow', icon: 'diagonal_1px_slow' },
- 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 348.
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 exports
has 387 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (CodeMirror) {
"use strict";
var HINT_ELEMENT_CLASS = "CodeMirror-hint";
var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirror-hint-active";
File carto.js
has 794 lines of code (exceeds 250 allowed). Consider refactoring. Open
carto_quotables = [
'text-face-name'
];
Class Member
has 96 methods (exceeds 20 allowed). Consider refactoring. Open
class Member
extend Forwardable
include Virtus.model
include CacheHelper
include Carto::VisualizationDependencies