Showing 280 of 280 total issues
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (this.fetchLoading || !this.displayName) {
// prettier-ignore
return html`<span class="formatted-segment" title="${this.filename}">${this.filename}:${this.number}</span>`
}
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
//prettier-ignore
return html`
<div class="static-page-container">
<div class="main-border">
Function addCatagoryFiles
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
addCatagoryFiles(files) {
let pictureFiles = preprocessMenuData(files);
let totalFilesList = [];
if (pictureFiles.length !== 0) {
totalFilesList = pictureFiles.map(
Similar blocks of code found in 2 locations. Consider refactoring. Open
while (i >= orig_i && tokens[i] != null) {
t = tokens[i--];
if (t == '+' || t == '^') continue;
if (consonant(t) == null) break;
out.unshift(t);
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
return html`
<text-view-search
.lang="${this.lang}"
.fileName="${this.fileName}"
.searchString="${this.searchString}"
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
while (tokens[i] != null) {
t = tokens[i++];
if (t == '+' || t == '^') continue;
if (consonant(t) == null) break;
out.push(t);
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
? html`
<multiselect-combo-box
Label="Hit Collections"
id="target-visual-view-dropdown"
item-label-path="collectionname"
- 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 render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return html`
<div class="static-page-container">
<div class="main-border">
<div class="main-content">
Function updated
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
updated(_changedProperties) {
super.updated(_changedProperties);
this.lang = getLanguageFromFilename(this.fileName);
_changedProperties.forEach(async (oldValue, propName) => {
if (propName === 'fileName' && !this.fetchLoading) {
Function fetchData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async fetchData() {
if (!this.fileName) {
this.fetchLoading = false;
return;
}
Function TextViewLayoutRight
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TextViewLayoutRight = (
textRight,
parallels,
clickFunction,
rightTextData,
Function parseDisplayData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
parseDisplayData(displayData, segmentnrString) {
this.displayName = displayData ? displayData[0] : '';
if (!this.shouldNotShowExtLink) {
if (
this.lang === LANGUAGE_CODES.SANSKRIT ||
- 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 TextSegment
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function TextSegment({
inputData,
lang,
colorValues,
onClick = 0,
- 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 fetchNewText
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async fetchNewText() {
this.fetchLoading = true;
const { textleft, parallels, error } = await getFileTextAndParallels({
fileName: this.fileName,
limit_collection: this.limitCollection,
- 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 preprocessMenuData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function preprocessMenuData(menuData) {
// this function has a bit of spaghetti-style; maybe we can refactor it at some point.
return menuData.map(menuEntry => {
menuEntry.imgStringPLI = '';
menuEntry.imgStringSKT = '';
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (!this.fileName) {
//prettier-ignore
return html`
<div class="data-view-subheader">
Function getIcon
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
getIcon(par_lang) {
if (!this.logo) {
return;
}
let title;
Similar blocks of code found in 2 locations. Consider refactoring. Open
} else if (this.selectedView === DATA_VIEW_MODES.GRAPH) {
return html`
<graph-view
.fileName="${this.fileName}"
.targetCollection="${this.targetCollection}"
- 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 56.
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
} else if (this.selectedView === DATA_VIEW_MODES.MULTILING) {
return html`
<table-view-multiling
.fileName="${this.fileName}"
.score="${this.score}"
- 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 56.
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 firstUpdated
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
firstUpdated(_changedProperties) {
super.firstUpdated(_changedProperties);
const currentUrl = window.location.href;
if (currentUrl.match('/chn/text/[TX][0-9]+$')) {
let textNr = currentUrl.match(/[TX][0-9]+$/g)[0];