catarse/catarse.js

View on GitHub

Showing 1,380 of 1,380 total issues

Function updateUserData has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        const updateUserData = (user_id) => {
            const userData = {};
            userData.bank_account_attributes = {
                bank_id: bankCode(),
                input_bank_number: bankInput(),
Severity: Minor
Found in legacy/src/c/user-balance-request-modal-content.js - About 1 hr to fix

    Function oninit has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        oninit: function(vnode) {
            const contributedProjects = prop(),
                user_id = vnode.attrs.userId,
                pages = contributionVM.getUserContributedProjectsWithFilter(),
                error = prop(false),
    Severity: Minor
    Found in legacy/src/c/user-contributed.js - About 1 hr to fix

      Function matcherFn_ has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) {
        return function() {
          var matcherArgs = jasmine.util.argsToArray(arguments);
          var result = matcherFunction.apply(this, arguments);
      
      
      Severity: Minor
      Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

        Function context has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const context = () => {
            const vm = catarse.filtersVM({
                full_text_index: 'plfts(portuguese)',
                state: 'eq',
                transfer_id: 'eq',
        Severity: Minor
        Found in legacy/src/vms/balance-transfer-filter-vm.js - About 1 hr to fix

          Function matches has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              return function matches(node) {
                if (!node) {
                  return []
                }
                if (isArray(node)) {
          Severity: Minor
          Found in legacy/spec/lib/mithril-query/mithril-query.js - About 1 hr to fix

            Function oninit has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                oninit: function(vnode) {
                    const following = prop(vnode.attrs.following || false),
                        followVM = catarse.filtersVM({ follow_id: 'eq' }),
                        loading = prop(false),
                        hover = prop(false),
            Severity: Minor
            Found in legacy/src/c/user-follow-btn.js - About 1 hr to fix

              Function oninit has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  oninit: function (vnode) {
                      const formName = 'report-infringes-intellectual-property',
                          relationWithViolatedPropertyError = prop(false),
                          fullNameError = prop(false),
                          fullAddressError = prop(false),
              Severity: Minor
              Found in legacy/src/c/project-report-infringes-intellectual-property.js - About 1 hr to fix

                Function css has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        const css = () => {
                            const cssClasses = {
                                small: {
                                    wrapper: '.w-col.w-col-4',
                                    innerWrapper: '.card-project.card.u-radius',
                Severity: Minor
                Found in legacy/src/c/project-card.js - About 1 hr to fix

                  Function RequestTracker has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function RequestTracker() {
                      var requests = [];
                  
                      this.track = function(request) {
                        requests.push(request);
                  Severity: Minor
                  Found in legacy/spec/lib/jasmine-ajax/mock-ajax.js - About 1 hr to fix

                    Function view has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        view({attrs}) {
                            const isSelected = attrs.isSelected;
                            const onSelect = attrs.onSelect;
                            const itemToString = attrs.itemToString;
                            const values = attrs.values;
                    Severity: Minor
                    Found in legacy/src/c/explore/explore-filter-select.ts - About 1 hr to fix

                      Function view has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          view({ state, attrs }) {
                      
                              const onSearch = attrs.onSearch;
                              const onSelect = attrs.onSelect;
                              const isLoading = attrs.isLoading;
                      Severity: Minor
                      Found in legacy/src/c/explore/explore-search-filter-select.js - About 1 hr 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 view has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          view: function({state, attrs}) {
                              const project = attrs.project;
                              const isSub = projectVM.isSubscription(project);
                      
                              return m('#project-highlight', [
                      Severity: Minor
                      Found in legacy/src/c/project-highlight.js - About 1 hr 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 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          oninit: function(vnode) {
                              const hash = prop(window.location.hash),
                                  displayTabContent = (project) => {
                                      const c_opts = {
                                              project,
                      Severity: Minor
                      Found in legacy/src/c/project-main.js - About 1 hr 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 toThrow has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                      jasmine.Matchers.prototype.toThrow = function(expected) {
                        var result = false;
                        var exception;
                        if (typeof this.actual != 'function') {
                          throw new Error('Actual is not a function');
                      Severity: Minor
                      Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr 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 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          oninit: function(vnode) {
                              const project = vnode.attrs.project,
                                  progress = project.progress.toFixed(2),
                                  remainingTextObj = h.translatedTime(project.remaining_time),
                                  elapsedTextObj = h.translatedTime(project.elapsed_time),
                      Severity: Minor
                      Found in legacy/src/c/project-card.js - About 1 hr 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 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          oninit: function(vnode) {
                              const emailText = prop(''),
                                  loading = prop(false),
                                  project = vnode.attrs.project,
                                  showSuccess = prop(false),
                      Severity: Minor
                      Found in legacy/src/c/project-email-invite.js - About 1 hr 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 view has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          view({ attrs: { goalDetails: goalsDetails, subscriptionData, style }, state } : m.Vnode<ProjectGoalsBoxAttrs, ProjectGoalsBoxState>) {
                      
                              const goalsDetailsOrEmpty = () : GoalDetails[] => {
                                  const hasGoalsDetails = goalsDetails() && goalsDetails().length > 0
                                  if (hasGoalsDetails) {
                      Severity: Minor
                      Found in legacy/src/c/project-goals-box.tsx - About 1 hr 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 reportSpecResults has a Cognitive Complexity of 12 (exceeds 5 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';
                      Severity: Minor
                      Found in legacy/spec/lib/jasmine-species/jasmine-reporting.js - About 1 hr 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 view has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          view({state, attrs}) {
                              
                              const projectsExploreVM : ProjectsExploreViewModel = state.projectsExploreVM;
                              const projectsCollection = projectsExploreVM.projectsView.collection();
                              const isContributedByFriendsFilter = projectsExploreVM.filter === 'contributed_by_friends';
                      Severity: Minor
                      Found in legacy/src/root/projects-explore.ts - About 1 hr 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 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          oninit: function(vnode) {
                              const mode = vnode.attrs.mode === 'sub' && vnode.attrs.isEdit ? vnode.attrs.isReactivate ? 'sub_reactivate' : 'sub_edit' : vnode.attrs.mode,
                                  questions = vnode.attrs.faq.questions,
                                  selectedQuestion = prop(-1),
                                  user = prop({ name: '...' }),
                      Severity: Minor
                      Found in legacy/src/c/faq-box.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language