Showing 118 of 895 total issues
File spdx.js
has 4654 lines of code (exceeds 250 allowed). Consider refactoring. Open
export default {
licenses: [
{
reference: './0BSD.html',
isDeprecatedLicenseId: false,
File dfg-mappings.js
has 1929 lines of code (exceeds 250 allowed). Consider refactoring. Open
const OECD_SCHEME = 'Fields of Science and Technology (FOS)';
const OECD_SCHEME_URI = 'http://www.oecd.org/science/inno/38235147.pdf';
const MAPPING = {
mappingListVersion: '1.0',
originalUrl:
File edit.js
has 480 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';
import { w } from '@ember/string';
import countryList from 'iso-3166-country-list';
Function submit
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
submit(doi) {
doi.set('event', this.setEvent(doi.get('state')));
// schema-version will be determined by API
doi.set('schemaVersion', 'http://datacite.org/schema/kernel-4');
Function submit
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
submit(doi) {
// change state via event if there is a change
let stateChange = doi.changedAttributes().state;
if (typeof stateChange !== 'undefined') {
doi.set('event', this.setEvent(stateChange));
File new.js
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';
import { w } from '@ember/string';
import countryList from 'iso-3166-country-list';
File doi.test.ts
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
/// <reference types="cypress" />
/* eslint-disable no-undef */
function escapeRE(string) {
//return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
File provider.js
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
import { computed } from '@ember/object';
import { reads } from '@ember/object/computed';
import { isPresent, isBlank } from '@ember/utils';
import { w } from '@ember/string';
Function didReceiveAttrs
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
didReceiveAttrs() {
this._super(...arguments);
if (this.model.get('landingPage').status == 200) {
let redirectText = 'resolved ';
`` has 29 functions (exceeds 20 allowed). Consider refactoring. Open
actions: {
toggleInput() {
let estimate = this.model.get('doiEstimate');
this.model.set('doiEstimate', '0');
Function doiFormErrors
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export function doiFormErrors([model]) {
let errorAttributes = model.validations.errors.mapBy('attribute');
// check validation errors for data model fragments if not in draft state
if (model.state !== 'draft' && ['new', 'edit'].includes(model.mode)) {
- 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 updateRelatedItemIdentifier
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateRelatedItemIdentifier(value) {
const ark = /^ark:\/[0-9]{5}\/\S+$/;
const lsid =
/^[uU][rR][nN]:[lL][sS][iI][dD]:(A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*'"%]):(A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*'"%]):(A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*'"%])[:]?(A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*'"%])?$/;
const purl = {
Function barChart
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
barChart() {
let formatYear = timeFormat('%Y');
// let formatFixed = format(",.0f");
let chartId = this.chartId;
Function barChart
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
barChart() {
let formatMonthYear = timeFormat('%B %Y');
// let formatFixed = format(",.0f");
let chartId = this.chartId;
Function donutChart
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
donutChart() {
let formatFixed = format(',.0f');
let chartId = this.chartId;
let data = this.data ? this.data : [];
Function reasonUtil
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export default function reasonUtil(val = null, hash = { default: '' }) {
let ret = hash.default;
if (val) {
if (typeof val === 'object') {
- 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 exports
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function () {
return {
clientAllowedKeys: [
'SITE_TITLE',
'NAVMENU_TITLE',
Function validate
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
validate(value, options, model) {
const ark = /^ark:\/[0-9]{5}\/\S+$/;
const lsid =
/^[uU][rR][nN]:[lL][sS][iI][dD]:(A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*'"%]):(A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*'"%]):(A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*'"%])[:]?(A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*'"%])?$/;
const purl = {
- 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 selectRe3Data
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
selectRe3Data(re3data) {
if (re3data) {
let self = this;
this.store
.findRecord('re3data', re3data.id)
Function validate
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
validate(value) {
if (!value) {
return true;
} else if (
value.startsWith('https://orcid.org') ||