Showing 11 of 33 total issues
Function exports
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (defaults) {
const app = new EmberApp(defaults, {
"ember-cli-babel": {
includePolyfill: true,
},
Function outputReady
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
outputReady(results) {
const env = this.app.env;
if (!(env === "production" || env === "staging")) {
return true;
Function transfers
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
transfers: computed("users.@each.balance", function () {
const users = get(this, "users");
const currency = get(this, "users.firstObject.event.currency");
const owed = users.filter(u => get(u, "balance") < 0).map(convertToUserAmount);
Function generateUniqueId
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function generateUniqueId() {
let now = new Date().getTime();
const duplicateTime = (now === lastPushTime);
lastPushTime = now;
- 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 parseTransaction
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function parseTransaction(transactionText) {
if (!transactionText || !transactionText.trim()) return null;
const parts = transactionText.trim().split(" ");
const onlyMePattern = /\.\s*me\s*$/;
- 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 settleUp
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
settleUp(transfer) {
get(this, "modal").trigger("show", {
name: "settle-up",
actions: {
yes: () => {
Function parseTransaction
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function parseTransaction(transactionText) {
if (!transactionText || !transactionText.trim()) return null;
const parts = transactionText.trim().split(" ");
const onlyMePattern = /\.\s*me\s*$/;
Function generateUniqueId
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function generateUniqueId() {
let now = new Date().getTime();
const duplicateTime = (now === lastPushTime);
lastPushTime = now;
Function initialize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize(application) {
const notify = application.__container__.lookup("service:notify");
if ("serviceWorker" in window.navigator) {
window.navigator.serviceWorker.register("/offline-support.js").then((registration) => {
Function reportError
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function reportError(error) {
if (Ember.testing) {
throw error;
}
- 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 transfers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
transfers: computed("users.@each.balance", function () {
const users = get(this, "users");
const currency = get(this, "users.firstObject.event.currency");
const owed = users.filter(u => get(u, "balance") < 0).map(convertToUserAmount);
- 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"