catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

Function oninit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    oninit(vnode) {
        
        h.scrollTop();
        const currentUser = h.getUser() || {};
        const hasFBAuth = currentUser.has_fb_auth;
Severity: Minor
Found in legacy/src/root/projects-explore.ts - About 25 mins to fix

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 getCurrentProject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const getCurrentProject = () => {
    const root = document.getElementById('application');
    const data = root && root.getAttribute('data-parameters');

    if (data) {
Severity: Minor
Found in legacy/src/vms/project-vm.ts - About 25 mins to fix

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 6 (exceeds 5 allowed). Consider refactoring.
Open

    oninit({ attrs: { goalDetails: goalsDetails, subscriptionData }, state } : m.Vnode<ProjectGoalsBoxAttrs, ProjectGoalsBoxState>) {
        const currentGoalIndex = prop(0)
        const getCurrentGoalIndex = (goalsDetails : GoalDetails[], {amount_paid_for_valid_period} : {amount_paid_for_valid_period : number}) => {
            if (goalsDetails.length > 0) {
                const index = _.findIndex(goalsDetails, goal => goal.value > amount_paid_for_valid_period)
Severity: Minor
Found in legacy/src/c/project-goals-box.tsx - About 25 mins to fix

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 closeModal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    closeModal = () => {
        // Temp for rails unstyled close links
        const close = (elm, selector) => {
            const all = document.getElementsByClassName(selector);
            let cur = elm.parentNode;
Severity: Minor
Found in legacy/src/h.ts - About 25 mins to fix

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 mountQuery has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private mountQuery() {

        const query : Query = { }

        if (this._mode !== 'all_modes') {
Severity: Minor
Found in legacy/src/vms/projects-explore-vm.ts - About 25 mins to fix

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 createDomFromListOrString has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

jasmine.reporting.StyledHtmlReporter.prototype.createDomFromListOrString = function(data, tags) {
    var classAttrs = '';
    if (typeof tags !== 'undefined') {
        classAttrs = (tags instanceof Array) ? tags.join(' ') : tags; 
    }
Severity: Minor
Found in legacy/spec/lib/jasmine-species/jasmine-reporting.js - About 25 mins to fix

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 createBasicPaginationVMWithAutoRedraw has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    createBasicPaginationVMWithAutoRedraw = vmInstance => {
        const error = prop(false);
        const errorMessage = prop('');

        return {
Severity: Minor
Found in legacy/src/h.ts - About 25 mins to fix

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 saveFields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private async saveFields(fields : string[], requiredFields : string[]) {
        
        this._isSavingProject = true
        
        h.redraw()
Severity: Minor
Found in legacy/src/vms/project-publish-by-steps-vm.ts - About 25 mins to fix

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 generateFormatNumber has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    generateFormatNumber = (s, c) => (number, n, x) => {
        if (!_.isNumber(number)) {
            return null;
        }

Severity: Minor
Found in legacy/src/h.ts - About 25 mins to fix

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 WhenChangeNationality has a Cognitive Complexity of 6 (exceeds 5 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) {
Severity: Minor
Found in legacy/src/c/projects/publish-by-steps/user-info-edit-settings.tsx - About 25 mins to fix

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

Severity
Category
Status
Source
Language