Showing 1,098 of 1,099 total issues
Function AutoComplete
has 400 lines of code (exceeds 25 allowed). Consider refactoring. Open
var AutoComplete = (function () {
function AutoComplete(el, domHandler, renderer, objectUtils, cd, differs) {
this.el = el;
this.domHandler = domHandler;
this.renderer = renderer;
Function Dialog
has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring. Open
var Dialog = (function () {
function Dialog(el, domHandler, renderer, zone) {
this.el = el;
this.domHandler = domHandler;
this.renderer = renderer;
- 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 PickList
has 378 lines of code (exceeds 25 allowed). Consider refactoring. Open
var PickList = (function () {
function PickList(el, domHandler, objectUtils) {
this.el = el;
this.domHandler = domHandler;
this.objectUtils = objectUtils;
Function ColorPicker
has 366 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ColorPicker = (function () {
function ColorPicker(el, domHandler, renderer, cd) {
this.el = el;
this.domHandler = domHandler;
this.renderer = renderer;
Function Tooltip
has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring. Open
var Tooltip = (function () {
function Tooltip(el, domHandler, renderer) {
this.el = el;
this.domHandler = domHandler;
this.renderer = renderer;
- 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 ObjectUtils
has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring. Open
var ObjectUtils = (function () {
function ObjectUtils() {
}
ObjectUtils.prototype.equals = function (obj1, obj2, field) {
if (field)
- 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 DomHandler
has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring. Open
var DomHandler = (function () {
function DomHandler() {
this.calculatedScrollbarWidth = null;
}
DomHandler.prototype.addClass = function (element, className) {
- 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 Dropdown
has 354 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Dropdown = (function () {
function Dropdown(el, domHandler, renderer, cd, objectUtils, zone) {
this.el = el;
this.domHandler = domHandler;
this.renderer = renderer;
Function Tree
has 346 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Tree = (function () {
function Tree(dragDropService) {
this.dragDropService = dragDropService;
this.selectionChange = new core_1.EventEmitter();
this.onNodeSelect = new core_1.EventEmitter();
Function ColorPicker
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
var ColorPicker = (function () {
function ColorPicker(el, domHandler, renderer, cd) {
this.el = el;
this.domHandler = domHandler;
this.renderer = renderer;
- 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 FileUpload
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
var FileUpload = (function () {
function FileUpload(domHandler, sanitizer, zone) {
this.domHandler = domHandler;
this.sanitizer = sanitizer;
this.zone = zone;
- 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 DomHandler
has 329 lines of code (exceeds 25 allowed). Consider refactoring. Open
var DomHandler = (function () {
function DomHandler() {
this.calculatedScrollbarWidth = null;
}
DomHandler.prototype.addClass = function (element, className) {
File tree.js
has 708 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
Function Dialog
has 321 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Dialog = (function () {
function Dialog(el, domHandler, renderer, zone) {
this.el = el;
this.domHandler = domHandler;
this.renderer = renderer;
Function Slider
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
var Slider = (function () {
function Slider(el, domHandler, renderer, ngZone) {
this.el = el;
this.domHandler = domHandler;
this.renderer = renderer;
- 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
static attemptPutInside(context: CommandContext, subject: WorldEntity, prep: CommandToken): CommandResult {
const container = prep.modifies;
if (!container || container.classification === TokenClassification.Verb) {
- 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 264.
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 attemptHang(context: CommandContext, subject: WorldEntity, prep: CommandToken): CommandResult {
const suspender = prep.modifies;
if (!suspender || suspender.classification === TokenClassification.Verb) {
- 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 264.
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 ConfirmDialog
has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring. Open
var ConfirmDialog = (function () {
function ConfirmDialog(el, domHandler, renderer, confirmationService, zone) {
var _this = this;
this.el = el;
this.domHandler = domHandler;
- 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 MultiSelect
has 277 lines of code (exceeds 25 allowed). Consider refactoring. Open
var MultiSelect = (function () {
function MultiSelect(el, domHandler, renderer, differs, objectUtils, cd) {
this.el = el;
this.domHandler = domHandler;
this.renderer = renderer;
Function Schedule
has 269 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Schedule = (function () {
function Schedule(el, differs) {
this.el = el;
this.aspectRatio = 1.35;
this.defaultView = 'month';