Showing 570 of 1,380 total issues
Function origin
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
var origin = (function(request,cookie) {
try {
var o = JSON.parse(cookie.get('ctrse_origin')||null) || {createdAt: new Date()};
} catch(e) {
o = {createdAt: new Date()};
Function parseDate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
I18n.parseDate = function(date) {
var matches, convertedDate, fraction;
// we have a date, so just return it.
if (typeof(date) == "object") {
return date;
Function reportSpecResults
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
jasmine.reporting.StyledHtmlReporter.prototype.reportSpecResults = function(spec) {
var results = spec.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.skipped) {
status = 'skipped';
Function WhenChangeNationality
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function WhenChangeNationality(user : UserDetails, states: prop<State[]>) : UserAddress {
const defaultCountryID = 36 // Brasil
const isInternational = Number(user.address.country_id) !== defaultCountryID
if (!_.isEmpty(states()) && !isInternational) {
Function view
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
view: function({state, attrs}) {
const payments = state.payments(),
transitions = state.transitions(),
notifications = state.notifications(),
reward = state.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"
Further reading
Function view
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
view: function({state, attrs}) {
const bankAccount = (_.isUndefined(state.metaBank) ? state.userBankAccount() : state.transitionBankAccount());
return m('#admin-balance-transfer-item-detail-box', [
m('.divider.u-margintop-20.u-marginbottom-20'),
- 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 safeVal
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const safeVal = (value, $target, cardNumberProp) => {
let currPair,
cursor,
digit,
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 createDom
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
var el = document.createElement(type);
for (var i = 2; i < arguments.length; i++) {
var child = arguments[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 reportSpecResults
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
var results = spec.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.skipped) {
status = 'skipped';
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
oninit: function(vnode) {
const vm = vnode.attrs.vm,
isSubscriptionEdit = vnode.attrs.isSubscriptionEdit || prop(false),
slipPaymentDate = projectVM.isSubscription() ? null : vm.getSlipPaymentDate(vnode.attrs.contribution_id),
loading = 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 validateCardExpiry
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const validateCardExpiry = function (month, year) {
let currentTime,
expiry,
ref;
if (typeof month === 'object' && 'month' in month) {
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
oninit: function(vnode) {
const displayForm = h.toggleProp(false, true),
displayFormWithName = prop(''),
sendSuccess = prop(false),
submitDisabled = 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 trySaveUserAttributesAndValidatePublishProject
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private async trySaveUserAttributesAndValidatePublishProject(userAttributes : any) {
const saveRequestConfig = {
method: 'PUT',
url: `/users/${this.user_id}.json`,
data: {
- 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 RedrawScheduler
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function RedrawScheduler() {
let redrawsRequestCounter = 0;
const markedCallStack = {};
const requestAnimationFramePolyfill = (function() {
if (window.requestAnimationFrame !== undefined) {
- 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 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
oninit: function(vnode) {
const {
ViewContentEvent,
} = projectVM;
Function oninit
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
oninit: function(vnode) {
const stats = prop([]),
projects = prop([]),
l = prop(),
sample3 = _.partial(_.sample, _, 3),
Function view
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
view({ state, attrs }) {
/** @type {HomeVM} */
const vm = state.vm;
const banners = vm.banners;
Function sendAnswer
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
sendAnswer = () => {
const data = {};
_.extend(data, {
survey_address_answers_attributes: {
addresses_attributes: addVM().getFields()
Function stateClass
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
stateClass = (state) => {
const classes = {
online: {
paid: 'text-success.fa-circle',
refunded: 'text-error.fa-circle',
Function oninit
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
oninit: function(vnode) {
let l = prop(false);
const deleteSuccess = prop(false),
confirmed = prop(true),
error = prop(''),