Showing 289 of 289 total issues
Function j
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
j = (function() {
function charType(n) {
return n <= 247
? e.charAt(n)
: 1424 <= n && n <= 1524
Function drawSelectionRange
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawSelectionRange(e, t, n) {
function add(e, t, n, r) {
t < 0 && (t = 0),
(t = Math.round(t)),
(r = Math.round(r)),
Identical blocks of code found in 2 locations. Consider refactoring. Open
handleMouseLeave = () => {
this.setState(state => {
const timeOut =
this.props.extendedTimeOut !== 0
? this.props.extendedTimeOut
- 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 117.
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
handleMouseLeave = () => {
this.setState(state => {
const timeOut =
this.props.extendedTimeOut !== 0
? this.props.extendedTimeOut
- 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 117.
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 componentDidMount
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function componentDidMount() {
var e = this
this.props.defineMode &&
this.props.defineMode.name &&
this.props.defineMode.fn &&
Consider simplifying this complex logical expression. Open
if (
(e.iter(l, n.line + 1, function(e) {
c &&
i.collapsed &&
!c.options.lineWrapping &&
Similar blocks of code found in 2 locations. Consider refactoring. Open
"./node_modules/react-styleguidist/loaders/style-loader.js!./node_modules/react-styleguidist/loaders/css-loader.js!./node_modules/codemirror/theme/base16-light.css": function(
e,
t,
n
) {
- 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 107.
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
"./node_modules/react-styleguidist/loaders/style-loader.js!./node_modules/react-styleguidist/loaders/css-loader.js!./node_modules/codemirror/lib/codemirror.css": function(
e,
t,
n
) {
- 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 107.
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 ./node_modules/react-styleguidist/lib/rsg-components/Editor/Editor.js
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
"./node_modules/react-styleguidist/lib/rsg-components/Editor/Editor.js": function(
e,
t,
n
) {
- 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 insertLineContent
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
function insertLineContent(e, t, n) {
var r = e.markedSpans,
o = e.text,
i = 0
if (r)
Function markText
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
function markText(e, t, n, r, o) {
if (r && r.shared) return markTextShared(e, t, n, r, o)
if (e.cm && !e.cm.curOp) return operation(e.cm, markText)(e, t, n, r, o)
var i = new xe(e, o),
a = cmp(t, n)
Function pollContent
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
(_e.prototype.pollContent = function() {
null != this.readDOMTimeout &&
(clearTimeout(this.readDOMTimeout), (this.readDOMTimeout = null))
var e = this.cm,
t = e.display,
Function onContextMenu
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
(Ve.prototype.onContextMenu = function(e) {
function prepareSelectAllHack() {
if (null != o.selectionStart) {
var e = n.somethingSelected(),
i = "" + (e ? o.value : "")
Similar blocks of code found in 2 locations. Consider refactoring. Open
(o = {
left: Math.min(s.left, l.left),
top: Math.min(s.top, l.top) - r,
right: Math.max(s.left, l.left),
bottom: Math.max(s.bottom, l.bottom) + r,
- 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 98.
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 o = calculateScrollPos(e, {
left: Math.min(t.left, n.left),
top: Math.min(t.top, n.top) - r,
right: Math.max(t.right, n.right),
bottom: Math.max(t.bottom, n.bottom) + r,
- 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 98.
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 onDrop
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
function onDrop(e) {
var t = this
if (
(clearDragCursor(t),
!signalDOMEvent(t, e) && !eventInWidget(t.display, e))
Function d
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
d = (function() {
function kw(e) {
return { type: e, style: "keyword" }
}
var e = kw("keyword a"),
Function init
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
;(_e.prototype.init = function(e) {
function onCopyCut(e) {
if (!signalDOMEvent(r, e)) {
if (r.somethingSelected())
setLastCopied({ lineWise: !1, text: r.getSelections() }),
Function Display
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Display(e, t, r) {
var o = this
;(this.input = r),
(o.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler")),
o.scrollbarFiller.setAttribute("cm-not-content", "true"),
Function measureCharInner
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function measureCharInner(e, t, n, r) {
var o,
i = nodeAndOffsetInLineMap(t.map, n, r),
l = i.node,
c = i.start,