Showing 327 of 327 total issues
Function exports
has a Cognitive Complexity of 699 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (context) {
const dom = context.dom
this.document = context.dom
this.outlineIcons = outlineIcons
- 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 exports
has 1847 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (context) {
const dom = context.dom
this.document = context.dom
this.outlineIcons = outlineIcons
Function UserInput
has a Cognitive Complexity of 444 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function UserInput (outline) {
var kb = UI.store
var myDocument = outline.document // is this ok?
// UI.log.warn("myDocument when it's set is "+myDocument.location);
- 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 UserInput
has 1799 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function UserInput (outline) {
var kb = UI.store
var myDocument = outline.document // is this ok?
// UI.log.warn("myDocument when it's set is "+myDocument.location);
Function render
has a Cognitive Complexity of 330 (exceeds 5 allowed). Consider refactoring. Open
render: function (s, doc) {
//* **********************************************
// NAMESPACES SECTION
//* **********************************************
var SIOC = UI.rdf.Namespace('http://rdfs.org/sioc/ns#')
- 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 render
has 1198 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function (s, doc) {
//* **********************************************
// NAMESPACES SECTION
//* **********************************************
var SIOC = UI.rdf.Namespace('http://rdfs.org/sioc/ns#')
File manager.js
has 1856 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* -*- coding: utf-8-dos -*-
Outline Mode Manager
*/
var panes = require('pane-registry')
const $rdf = require('rdflib')
File userInput.js
has 1806 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Original author: kennyluck
//
// Kenny's Notes:
/* places to generate SPARQL update: clearInputAndSave() pasteFromClipboard()->insertTermTo();
undetermined statement generated formUndetStat()
Function render
has a Cognitive Complexity of 179 (exceeds 5 allowed). Consider refactoring. Open
render: function (s, context) {
var dom = context.dom
var common = function (x, y) {
// Find common members of two lists
var both = []
- 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 microblogPane.js
has 1212 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
Microblog pane
Charles McKenzie <charles2@mit.edu>
*/
/* global alert */
Function render
has 608 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function (subject, context) {
const dom = context.dom
var kb = context.session.store
var ns = UI.ns
var invitation = subject
Function render
has a Cognitive Complexity of 149 (exceeds 5 allowed). Consider refactoring. Open
render: function (subject, context) {
const dom = context.dom
var kb = context.session.store
var ns = UI.ns
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
var transactionRow = function (dom, x) {
var tr = dom.createElement('tr')
var setTRStyle = function (tr, account) {
// var mystyle = "padding: 0.5em 1.5em 1em 1.5em; ";
- 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 505.
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
var transactionRow = function (dom, x) {
var tr = dom.createElement('tr')
var setTRStyle = function (tr, account) {
// var mystyle = "padding: 0.5em 1.5em 1em 1.5em; "
- 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 505.
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 render
has 467 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function (subject, context) {
const dom = context.dom
var kb = context.session.store
var fetcher = kb.fetcher
var Q = $rdf.Namespace('http://www.w3.org/2000/10/swap/pim/qif#')
Function render
has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring. Open
render: function (subject, context) {
const dom = context.dom
var kb = context.session.store
var WF = $rdf.Namespace('http://www.w3.org/2005/01/wf/flow#')
var QU = $rdf.Namespace('http://www.w3.org/2000/10/swap/pim/qif#')
- 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 schedulePane.js
has 861 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* Scheduler Pane
**
**
*/
/* global alert */
Function render
has 407 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function (s, context) {
var dom = context.dom
var common = function (x, y) {
// Find common members of two lists
var both = []
Function render
has 366 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function (subject, context, paneOptions: any) {
const dom = context.dom
const store = context.session.store
// Utility functions
var complainIfBad = function (ok: boolean, message: string) {
Function render
has 363 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function (subject, context) {
const dom = context.dom
var kb = context.session.store
var WF = $rdf.Namespace('http://www.w3.org/2005/01/wf/flow#')
var QU = $rdf.Namespace('http://www.w3.org/2000/10/swap/pim/qif#')