Showing 10 of 20 total issues
File currency-codes.js
has 1459 lines of code (exceeds 250 allowed). Consider refactoring. Open
import EmberObject from '@ember/object';
import { A } from '@ember/array';
/***/
Function convertSecondsString
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
convertSecondsString(seconds, format, padHours=false, showSeconds=false, longFormat=false, toFixed=2) {
let timeStr = '';
// format can be passed in to override the users ability to change
// the format.
- 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 setup
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup() {
let lastId = null;
let lastDesc = null;
this.comments.forEach(line => {
line.replace(/^(@([^ ]*)( ([^\{][^ ]*))?( \{([^\}]*)?\})?)?([\s\S]*)$/, (...args) => {
Function convertSecondsString
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
convertSecondsString(seconds, format, padHours=false, showSeconds=false, longFormat=false, toFixed=2) {
let timeStr = '';
// format can be passed in to override the users ability to change
// the format.
Function _printMethods
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
_printMethods(arr) {
arr.forEach(item => {
this.writeBlocks(2,
chalk.green(item.getProperty('method').name),
chalk.yellow(item.getProperty('returns').type),
Function _printProps
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_printProps(arr) {
arr.forEach(item => {
const optional = item.isOptional ? 'optional' : '';
const required = item.isRequired ? 'required' : '';
const readOnly = item.isReadOnly ? 'readonly' : '';
Function convertSecondsString
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
convertSecondsString(seconds, format, padHours=false, showSeconds=false, longFormat=false, toFixed=2) {
Function type
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
type() {
assert.funcNumArgs(arguments, 0, true);
let name = window.navigator.userAgent;
if (this.isBrowserType("Opera")) { // Opera
- 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 osType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
osType() {
assert.funcNumArgs(arguments, 0, true);
let osType = "Unknown OS";
if (window.navigator.appVersion.indexOf("Win") !== -1) { // windows os
- 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 _class
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_class() {
const _class = this.find(this.docs, 'class');
if (!isNone(_class)) {
const val = _class.getProperty('class');
const classString = val.desc.shift();
- 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"