Showing 570 of 1,380 total issues
Function view
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
view: function({state, attrs}) {
// @TODO: remove all those things from the view
const project = attrs.project,
elapsed = project().elapsed_time,
remaining = project().remaining_time,
- 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 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
view({state}) {
const project = _.first(state.projectDetails());
const reward = _.first(state.reward());
return [
project ?
Function oninit
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
oninit: function(vnode) {
const loadReward = () => {
const reward = prop({});
Function scan
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
function scan(render) {
const states = {}
const onremovers = []
const renderNode = renderComponents(states, onremovers)
const api = {
- 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 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
oninit: function(vnode) {
const {
ViewContentEvent,
AddToCartEvent
} = projectVM;
Function oninit
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
oninit: function (vnode) {
const vm = projectBasicsVM,
mapErrors = [
['name', ['name']],
['public_tags', ['public_tags']],
Function oninit
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
oninit: function(vnode) {
const vm = projectCardVM,
mapErrors = [
['uploaded_image', ['uploaded_image']],
['cover_image', ['cover_image']],
- 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 next_
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
jasmine.Queue.prototype.next_ = function() {
var self = this;
var goAgain = true;
while (goAgain) {
- 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 renderComponents
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
function renderComponents(states, onremovers) {
function renderComponent(component, treePath) {
if (isFunction(component.tag)) {
component.instance = component.tag(component)
} else if (isClass(component.tag)) {
- 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 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
oninit: function(vnode) {
const
showError = prop(false),
loader = catarse.loaderWithToken,
showPreview = h.toggleProp(false, true),
Function oninit
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
oninit: function (vnode) {
const { project_id, user_id } = vnode.attrs;
const project = projectVM.fetchProject(project_id);
const c_opts = { project_id, user_id, project };
const hash = prop(window.location.hash);
Function view
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
view: function({state, attrs}) {
const reward = state.normalReward(attrs.reward);
return (h.rewardSouldOut(reward) ? m('') : m('span.radio.w-radio.w-clearfix.back-reward-radio-reward', {
class: state.isSelected(reward) ? 'selected' : '',
- 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 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
oninit: function(vnode) {
const filtersVM = vnode.attrs.filtersVM,
visitorsTotal = prop(0),
visitorLoader = catarseMoments.loaderWithToken,
loader = commonAnalytics.loaderWithToken,
File admin-balance-tranfers.js
has 340 lines of code (exceeds 250 allowed). Consider refactoring. Open
import m from 'mithril';
import prop from 'mithril/stream';
import h from '../h';
import _ from 'underscore';
import balanceTransferListVM from '../vms/balance-transfer-list-vm';
File common-payment-vm.js
has 340 lines of code (exceeds 250 allowed). Consider refactoring. Open
import m from 'mithril';
import prop from 'mithril/stream';
import _ from 'underscore';
import projectVM from '../vms/project-vm';
import addressVM from '../vms/address-vm';
Function oninit
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
oninit: function(vnode) {
h.analytics.windowScroll({ cat: 'project_start', act: 'start_page_scroll' });
const stats = prop([]),
categories = prop([]),
selectedPane = prop(0),
Function oninit
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
oninit: function(vnode) {
const subscription = vnode.attrs.subscription,
displayModal = h.toggleProp(false, true),
displayCancelModal = h.toggleProp(false, true),
displayPaymentHistoryModal = h.toggleProp(false, true),
- 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 addressVM
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
const addressVM = (args) => {
const data = args.data;
const international = prop();
const statesLoader = catarse.loader(models.state.getPageOptions());
- 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 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
oninit: function (vnode) {
let parsedErrors = userSettingsVM.mapRailsErrors(vnode.attrs.rails_errors);
const user = vnode.attrs.user;
const fields = {
agency: prop(''),
Function htmlentities
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
function htmlentities(text) {
return text
.replace(/\"/gi, '"')
.replace(/\'/gi, '\'')
.replace(/\&/gi, '&')