Showing 89 of 875 total issues
Function exports
has 168 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(environment) {
const ENV = {
modulePrefix: 'client',
environment,
rootURL: '/',
Function exports
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(defaults) {
const app = new EmberApp(defaults, {
browseryStats: IS_DEV,
hinting: IS_TEST,
tests: IS_TEST,
File list.js
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Component from '@ember/component';
import { all, task } from 'ember-concurrency';
import EmberObject, { get, getProperties, set, observer } from '@ember/object';
import { inject as service } from '@ember/service';
import { isEmpty } from '@ember/utils';
Function setHeadTags
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
setHeadTags(model) {
const tags = [];
const content = get(model, 'content');
if (content) {
const description = content.substring(0, 140);
Function setHeadTags
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
setHeadTags(model) {
const tags = [];
const content = get(model, 'content');
if (content) {
const description = content.substring(0, 140);
Function didReceiveAttrs
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
didReceiveAttrs() {
this._super(...arguments);
set(this, 'isPermalink', get(this, 'router.currentRouteName') === 'posts');
- 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
File create-post.js
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { get, set, setProperties, getProperties, computed } from '@ember/object';
import { isEmpty, isPresent } from '@ember/utils';
import { empty, notEmpty, and, or, equal } from '@ember/object/computed';
Function link
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
link: computed('activity', function() {
const activity = get(this, 'activity');
const streamId = get(this, 'group.streamId');
const queryParams = { isQueryParams: true, values: { notification: streamId } };
const [modelType, modelId] = get(activity, 'foreignId').split(':');
- 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 link
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: computed('activity', function() {
const activity = get(this, 'activity');
const streamId = get(this, 'group.streamId');
const queryParams = { isQueryParams: true, values: { notification: streamId } };
const [modelType, modelId] = get(activity, 'foreignId').split(':');
Function setHeadTags
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
setHeadTags(model) {
const data = [{
type: 'meta',
tagId: 'meta-description',
attrs: {
Function setHeadTags
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
setHeadTags(model) {
const description = get(model, 'content').substring(0, 140);
return [{
type: 'meta',
tagId: 'meta-description',
Function primaryUnit
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
primaryUnit: computed('stat.time', function () {
if (get(this, 'kind') === 'anime') {
const time = moment.duration(get(this, 'stat.time'), 'seconds');
for (let i = 0; i < UNITS.length; i += 1) {
const unitTime = time.as(UNITS[i]);
- 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 headTags
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
headTags() {
const title = get(this, 'head.title');
const description = 'Share anime and manga experiences, get recommendations and see what friends are watching or reading.';
return [{
type: 'title',
Function exports
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function() {
return {
name: 'Kitsu',
short_name: 'Kitsu',
lang: 'en-US',
File countries.js
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
export default {
BD: 'Bangladesh',
BE: 'Belgium',
BF: 'Burkina Faso',
BG: 'Bulgaria',
Function thumbSize
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
const thumbSize = (length, orientation, index) => {
const max = 538;
const margin = 4;
if (orientation === 'square') {
const box = (max - 4) / 2;
Function createPost
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
createPost: task(function* (content, options) {
const data = { content, user: get(this, 'session.account'), ...options };
// posting on another user's profile
if (get(this, 'user') !== undefined && get(this, 'user.id') !== get(this, 'session.account.id')) {
set(data, 'targetUser', get(this, 'user'));
Function exports
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(deployTarget) {
const ENV = {
build: {},
s3: {
bucket: 'kitsu-web',
Function didReceiveAttrs
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
didReceiveAttrs() {
this._super(...arguments);
set(this, 'isPermalink', get(this, 'router.currentRouteName') === 'posts');
Function setHeadTags
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
setHeadTags(model) {
const description = get(model, 'reaction');
return [{
type: 'meta',
tagId: 'meta-description',