Showing 570 of 1,380 total issues
Function view
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
view({state, attrs}) {
const projectsExploreVM : ProjectsExploreViewModel = state.projectsExploreVM;
const projectsCollection = projectsExploreVM.projectsView.collection();
const isContributedByFriendsFilter = projectsExploreVM.filter === 'contributed_by_friends';
ProjectsExploreViewModel
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
export class ProjectsExploreViewModel {
private _observer : Observer<Query>;
private _categories : Category[];
private _mode : Mode;
Function view
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
view: function({state}) {
const project = _.first(state.projectDetails()),
isSubscription = projectVM.isSubscription(project),
recipients = state.fields.recipients;
- 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 oninit
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
oninit: function(vnode) {
const vm = vnode.attrs.vm,
isSubscriptionEdit = vnode.attrs.isSubscriptionEdit || prop(false),
subscriptionEditConfirmed = prop(false),
showSubscriptionModal = prop(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
File mithril-query.js
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
const m = require('mithril/render/hyperscript')
const cssauron = require('cssauron')
const code = require('yields-keycode')
Function view
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
view: function({state, attrs}) {
const isInternational = state.vm.isInternational();
return m('.w-form.u-marginbottom-40', {
oncreate: state.loadPagarme
- 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 oninit
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
oninit: function(vnode) {
let parsedErrors = userSettingsVM.mapRailsErrors(railsErrorsVM.railsErrors());
let deleteFormSubmit;
const user = vnode.attrs.user();
const userAddress = user.address || {};
Function oninit
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
oninit: function (vnode) {
const reward = vnode.attrs.reward(),
imageFileToUpload = prop(null),
isUploadingRewardImage = prop(false),
isDeletingRewardImage = prop(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 oninit
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
oninit: function(vnode) {
const {
survey_id
} = vnode.attrs,
contributionId = m.route.param('contribution_id'),
Function addressVM
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
const addressVM = (args) => {
const data = args.data;
const international = prop();
const statesLoader = catarse.loader(models.state.getPageOptions());
Function view
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
view({ attrs, state } : m.Vnode<UserInfoEditPublicProfileAttrs, UserInfoEditPublicProfileState>) {
const user = attrs.user
const hasErrorOn = attrs.hasErrorOn
const getErrorsOn = attrs.getErrorsOn
const onSelectProfileImage = attrs.onSelectProfileImage
File project-basics-edit.js
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
import m from 'mithril';
import prop from 'mithril/stream';
import _ from 'underscore';
import { catarse } from '../api';
import models from '../models';
File payment-vm.js
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
import m from 'mithril';
import prop from 'mithril/stream';
import _ from 'underscore';
import moment, { defaultFormat } from 'moment';
import h from '../h';
Function view
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
view({ attrs, state } : m.Vnode<ShareAttrs, ShareState>) {
const project = attrs.project
const projectUrl = `${window.location.origin}/${project.permalink}`
const copyToClipboard = (copyText : HTMLInputElement) => {
Function view
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
view: function({state, attrs}) {
const list = state.listVM,
project = attrs.project() || {},
postHeader = (post) => _.map(post.rewards_that_can_access_post, r => ` R$${h.formatNumber(r.minimum_value)}${r.title ? ` - ${r.title}` : ''}`),
postTextSubscription = (post) => `Post exclusivo para assinantes${ post.rewards_that_can_access_post ? ' de' : ''}${postHeader(post)}`,
- 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 view
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
view: function({state, attrs}) {
const contribution = attrs.contribution(),
project = attrs.project(),
survey = _.first(state.survey()),
profileImg = (_.isEmpty(contribution.profile_img_thumbnail) ? '/assets/catarse_bootstrap/user.jpg' : contribution.profile_img_thumbnail),
- 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 publish-vm.js
has 378 lines of code (exceeds 250 allowed). Consider refactoring. Open
import m from 'mithril';
import h from '../h';
const formattedServiceFee = (project) => (project.service_fee * 100).toFixed(2).replace(/(\.|,)?0+$/g, '');
Function view
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
view({ attrs, state } : m.Vnode<CardEditAttrs, CardEditState>) {
const project = attrs.project
const isSaving = attrs.isSaving
const save = attrs.save
Function oninit
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
oninit({ attrs, state }: m.Vnode<RewardsEditListAttrs, RewardsEditListState>) {
const rewards = prop<StreamType<RewardDetailsStream>[]>([])
const loading = attrs.loading
const error = attrs.error
const errors = attrs.errors
Function view
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
view: function ({
state,
attrs
}) {
const reward = attrs.reward();
- 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"