Showing 280 of 280 total issues
Function updated
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updated(_changedProperties) {
_changedProperties.forEach(async (oldValue, propName) => {
if (propName === 'fileName' && !this.fetchLoading) {
if (!('leftTextData' in _changedProperties)) {
this.handleFilenameChanged();
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const renderSwitchButton =
this.renderSwitchButton && this.rightFileName !== '';
//prettier-ignore
Function styles
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static get styles() {
return [
css`
.data-view-subheader {
display: flex;
Function fetchNewText
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async fetchNewText() {
this.fetchLoading = true;
const { textleft, parallels, error } = await getFileTextAndParallels({
fileName: this.fileName,
limit_collection: this.limitCollection,
Function fetchDataText
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async fetchDataText() {
if (!this.rightFileName) {
this.fetchLoading = false;
return;
}
Function styles
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static get styles() {
return [
css`
.bn-loading-spinner {
width: 48px;
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return html`
<div class="static-page-container">
<div class="main-border">
<div class="main-content">
Function displayParallels
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
displayParallels(element) {
if (!element) {
return;
}
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const showMiddleData = !isObjectEmpty(this.middleData);
if (!this.fileName) {
return null;
Function addSegmentObservers
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
async addSegmentObservers() {
if (this.addedSegmentObservers) {
return;
}
const targets = this.shadowRoot.querySelectorAll('.left-segment');
- 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
Open
render() {
const shouldShowTransliterationSlider =
((this.language === 'tib' || this.language === 'multi') &&
this.viewMode != 'graph') ||
this.viewMode === 'english';
- 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 TextSegmentWords
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function TextSegmentWords(
inputData,
lang,
colorValues,
highlightMode,
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
if (this.selectedView === DATA_VIEW_MODES.TEXT_SEARCH) {
return html`
<text-view-search
.lang="${this.lang}"
Function updated
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updated(_changedProperties) {
super.updated(_changedProperties);
this.lang = getLanguageFromFilename(this.fileName);
_changedProperties.forEach(async (oldValue, propName) => {
if (propName === 'pageNumber' && !this.fetchLoading) {
Function getExternalLinkName
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getExternalLinkName(language, externalLink) {
if (!externalLink) {
return;
}
let linkName = '';
Function styles
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static get styles() {
return [
css`
:host {
display: inline-flex;
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return html`
<div class="static-page-container">
<div class="main-border">
<div class="main-content">
Function fetchData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async fetchData() {
this.fetchLoading = true;
const { link, error } = await getExternalLink({
fileName: this.filename,
});
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return html`
<div class="static-page-container lang_chn">
<div class="main-border">
<div class="main-content">
Function initializeFilterValues
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initializeFilterValues(lang) {
switch (lang) {
case LANGUAGE_CODES.TIBETAN:
this.minLength = MIN_LENGTHS.TIBETAN;
this.quoteLength = DEFAULT_LENGTHS.TIBETAN;