Showing 142 of 142 total issues
Function updateObjectEndDrag
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const updateObjectEndDrag = (state, action) => {
if (!action.target) {
return {
dragInProgress: null,
};
Function process
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
async process() {
try {
this.validate();
// update links
const rawRows = await linkDao.listByUseridAndTag(this.data.userid, this.data.oldTagName);
Function getKeyContent
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getKeyContent = (content) => {
const currentFeedData = [];
if (!content) {
return 'No content found';
} else if (content['rdf:RDF']) {
Function getDisplayContent
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getDisplayContent = (content, newIds) => {
const currentFeedData = [];
if (!content) {
return 'No content found';
} else if (content['rdf:RDF']) {
Function onImport
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
async onImport(docs) {
// docs contains all link-objects to be imported
docs.forEach((doc) => { this.counterLink(doc); });
// now this.allLinks contains all imported pureUrls/#
assert(this.allLinks.size < 2);
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (READONLY_TAGS.findIndex(e => e === this.data.name) !== -1) {
throw new Error(`Cannot delete ${this.data.name} because this is a system tag.`);
}
- 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 61.
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
if (READONLY_TAGS.findIndex(e => e === this.data.oldTagName) !== -1) {
throw new Error(`Change to ${this.data.oldTagName} not possible`);
}
- 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 61.
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 getDisplayContent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const getDisplayContent = (content, newIds) => {
const currentFeedData = [];
if (!content) {
return 'No content found';
} else if (content['rdf:RDF']) {
- 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 getKeyContent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const getKeyContent = (content) => {
const currentFeedData = [];
if (!content) {
return 'No content found';
} else if (content['rdf:RDF']) {
- 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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
render() {
if (!this.props.selectedTag || this.props.tagHierarchy.size === 0) {
return null;
}
const cachedTagHierarchy = new CachedTagHierarchy(this.props.tagHierarchy);
- 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
if (varName === 'SERVER_PROPS_LOADER') {
const name = defaultValue.trim().substr(1, defaultValue.length - 2);
return `'${BuildInfo[name]}'`;
}
- 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 58.
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
if (varName === 'SERVER_PROPS_LOADER') {
const name = defaultValue.trim().substr(1, defaultValue.length - 2);
return `'${BuildInfo[name]}'`;
}
- 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 58.
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 mapToNetscapeTree
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mapToNetscapeTree = (parentToElementMap, linklist) => {
if (!parentToElementMap.$$PARENT_OF_ROOT$$) {
return {};
}
const addChildren = (targetParent, sourceParent) => {
Function createRecord
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createRecord = async (rec, userid) => {
const { url, rssUrl, tagsAsString, tagsAsArray, pageTitle, notes } = rec;
const fixedUrl = fixUrl(url);
const fixedRssUrl = fixUrl(rssUrl);
const fixedTags = Object.prototype.hasOwnProperty.call(rec, 'tagsAsString') ? getTags(tagsAsString) : getTagsFromArray(tagsAsArray);
Function process
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async process() {
try {
const userInput = this.data.q;
// let luceneQuery = '';
// fields.forEach((f) => {
Similar blocks of code found in 2 locations. Consider refactoring. Open
<FormGroup controlId="row3controls">
<UIInputElement
label="Notes"
model="notes"
placeholder="Just some notes"
- 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 57.
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
<FormGroup controlId="row1controls">
<UIInputElement
label="NETSCAPE-Bookmark-file-1"
model="bookmarks"
placeholder="!DOCTYPE NETSCAPE-Bookmark-file-1"
- 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 57.
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 validateData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
validateData() {
const usedNames = {};
const usedIndexs = {};
this.data.tree.forEach((treeElement) => {
if (usedNames[treeElement.name]) {
Function process
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
async process() {
try {
const user = await userDao.getByEmail(this.data.email);
if (user == null) {
ResponseUtil.sendErrorResponse(401, 'Wrong user or password!', this.res);
Function scrape
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static async scrape(cachePath, url) {
const filename = CreateArchiveProcessor.getFilename(url);
// we need to store all content-types into the file `SCRAPED_MIME_TYPE_MAP`.
// see server/httpRoutes/archive.js at "FILE `SCRAPED_MIME_TYPE_MAP`"
const urlToContentTypeMap = new Map();