Showing 53 of 53 total issues
Function update
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function update(container, events, showAFK, chunkfunc, eventfunc) {
Function periodLengthConvertMoment
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function periodLengthConvertMoment(periodLength: string) {
const settingsStore = useSettingsStore();
if (periodLength === 'day') {
return 'day';
} else if (periodLength === 'week') {
- 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 update_buckets
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
update_buckets(this: State, buckets: IBucket[]): void {
this.buckets = _.orderBy(buckets, [b => b.id], ['asc']).map(b => {
// Some harmonization as aw-server-rust and aw-server-python APIs diverge slightly
if (!b.last_updated && b.metadata && b.metadata.end) {
b.last_updated = b.metadata.end;
- 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 getColorFromCategory
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getColorFromCategory(c: Category, allCats: Category[]): string {
// Returns the color for a certain category, falling back to parents if none set
if (c && c.data && c.data.color) {
return c.data.color;
} else if (c && c.name.slice(0, -1).length > 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 save
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async save() {
// We want to avoid saving to localStorage to not accidentally mess up pre-migration data
// For example, if the user is using several browsers, and opened in their non-main browser on first run after upgrade.
const saveToLocalStorage = false;
- 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 handleError
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function handleError(error, vm, info) {
let cur = vm;
while ((cur = cur.$parent)) {
const hooks = cur.$options.errorCaptured || [];
for (const hook of hooks) if (hook.call(cur, error, vm, info) === false) break;
- 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 buildTooltip
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function buildTooltip(bucket, e) {
// WARNING: XSS risk, make sure to sanitize properly
// FIXME: Not actually tested against XSS attacks, implementation needs to be verified in tests.
let inner = 'Unknown bucket type';
- 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
Avoid too many return
statements within this function. Open
return 'YYYY-MM-DD';
Avoid too many return
statements within this function. Open
return 'day';
Avoid too many return
statements within this function. Open
return e.data.title;
Avoid too many return
statements within this function. Open
return e.data.label;
Function createClient
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function createClient(force?: boolean): AWClient {
let baseURL = '';
const production = typeof PRODUCTION !== 'undefined' && PRODUCTION;
- 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 getScoreFromCategory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getScoreFromCategory(c: Category, allCats: Category[]): number {
// Returns the score for a certain category, falling back to parents if none set
// Very similar to getColorFromCategory
if (c && c.data && c.data.score) {
return c.data.score;
- 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"