Showing 342 of 342 total issues
File top_bar.js
has 608 lines of code (exceeds 250 allowed). Consider refactoring. Open
// console.log("Loading TopBar...")
Spontaneous.TopBar = (function($, S) {
var dom = S.Dom, Ajax = S.Ajax;
Function File
has 258 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.Field.File = (function($, S) {
var dom = S.Dom;
var FileField = new JS.Class(Spontaneous.Field.String, {
selected_files: false,
Function EditPanel
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.EditPanel = (function($, S) {
var dom = S.Dom, Dialogue = Spontaneous.Dialogue;
var EditPanel = new JS.Class(Dialogue, {
initialize: function(parent_view) {
- 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
Function PageView
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.Views.PageView = (function($, S, document) {
var dom = S.Dom, user = S.User, ajax = S.Ajax, Types = S.Types;
var FunctionBar = function(page) {
this.page = page;
- 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
Function EditPanel
has 238 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.EditPanel = (function($, S) {
var dom = S.Dom, Dialogue = Spontaneous.Dialogue;
var EditPanel = new JS.Class(Dialogue, {
initialize: function(parent_view) {
Function AddAliasDialogue
has 232 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.AddAliasDialogue = (function($, S, window) {
'use strict';
var dom = S.Dom, Dialogue = Spontaneous.Dialogue;
var Target = function(data, element) {
Function UploadManager
has 230 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.UploadManager = (function($, S) {
var dom = S.Dom;
var Upload = S.Upload;
var WrapUpload = new JS.Class(Upload, {
start: function() {
Function Content
has 230 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.Content = (function($, S) {
'use strict';
var dom = S.Dom;
var Content = new JS.Class({
Function Image
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.Field.Image = (function($, S) {
'use strict';
var dom = S.Dom;
var ImageFieldConflictView = new JS.Class(S.Field.String.ConflictView, {
- 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
Function UploadManager
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.UploadManager = (function($, S) {
var dom = S.Dom;
var Upload = S.Upload;
var WrapUpload = new JS.Class(Upload, {
start: function() {
- 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 user_admin.js
has 509 lines of code (exceeds 250 allowed). Consider refactoring. Open
Spontaneous.MetaView.UserAdmin = (function($, S){
var dom = S.Dom, ajax = S.Ajax;
var Level = new JS.Class({
initialize: function(attributes) {
Function PieceView
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.Views.PieceView = (function($, S) {
var dom = S.Dom, user = S.User;
var debug = 0;
var ConfirmDeletePopup = new JS.Class(Spontaneous.PopoverView, {
Function Content
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.Content = (function($, S) {
'use strict';
var dom = S.Dom;
var Content = new JS.Class({
- 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
Function Dialogue
has 193 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.Dialogue = (function($, S) {
var dom = S.Dom;
var Button = new JS.Class({
Function String
has 193 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.Field.String = (function($, S) {
var dom = S.Dom;
var StringFieldConflictView = new JS.Class({
initialize: function(dialogue, conflict) {
this.dialogue = dialogue;
Function ShardedUpload
has 190 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.ShardedUpload = (function($, S) {
var dom = S.Dom;
var upload_id = (new Date()).valueOf();
var Shard = new JS.Class({
initialize: function(uploader, index, blob) {
Function AddAliasDialogue
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.AddAliasDialogue = (function($, S, window) {
'use strict';
var dom = S.Dom, Dialogue = Spontaneous.Dialogue;
var Target = function(data, element) {
- 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
Identical blocks of code found in 2 locations. Consider refactoring. Open
aliasTargetLink: function() {
var self = this;
if (!self.isAlias()) {
return '';
}
- 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 179.
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
aliasTargetLink: function() {
var self = this;
if (!self.isAlias()) {
return '';
}
- 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 179.
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 Scope
has 51 methods (exceeds 20 allowed). Consider refactoring. Open
class Scope
def initialize(dataset, schema)
@dataset = dataset
@schema = schema