catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

Function loadNotifications has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        const loadNotifications = () => {
            const notificationsInternal = prop([]);            
            const addNotificationsToInternal = (notifications) => notificationsInternal(notifications);

            // First loads the first page and configure the next interactions
Severity: Minor
Found in legacy/src/c/admin-subscription-detail.js - About 1 hr to fix

    Function p has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            const p = new Promise((resolve, reject) => {
                m.request({
                    method: 'GET',
                    url: `/payment/pagarme/${contribution_id}/get_encryption_key`,
                    config: setCsrfToken
    Severity: Minor
    Found in legacy/src/vms/payment-vm.js - About 1 hr to fix

      Function updateProject has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const updateProject = async (project_id) => {
          const projectData = {
              tracker_snippet_html: fields.tracker_snippet_html(),
              user_id: fields.user_id(),
              all_tags: fields.admin_tags(),
      Severity: Minor
      Found in legacy/src/vms/project-basics-vm.js - About 1 hr to fix

        Function runFunctionsWithinRange has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
          var scheduledFunc;
          var funcsToRun = [];
          for (var timeoutKey in this.scheduledFunctions) {
            scheduledFunc = this.scheduledFunctions[timeoutKey];
        Severity: Minor
        Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

          Function displayTabContent has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      displayTabContent = (project) => {
                          const c_opts = {
                                  project,
                                  post_id: vnode.attrs.post_id,
                                  subscriptionData: vnode.attrs.subscriptionData
          Severity: Minor
          Found in legacy/src/c/project-main.js - About 1 hr to fix

            Function ajax has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              var ajax = (function(){
                //based on https://raw.githubusercontent.com/yanatan16/nanoajax/v0.2.4/index.js
                function getRequest() {
                  if (window.XMLHttpRequest)
                    return new window.XMLHttpRequest;
            Severity: Minor
            Found in legacy/spec/lib/analytics.js - About 1 hr to fix

              Function RedrawScheduler has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function RedrawScheduler() {
                  let redrawsRequestCounter = 0;
                  const markedCallStack = {};
                  const requestAnimationFramePolyfill = (function() {
                      if (window.requestAnimationFrame !== undefined) {
              Severity: Minor
              Found in legacy/src/h.ts - About 1 hr to fix

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

                    view({ attrs, state } : m.Vnode<ExploreMobileSearchAttrs, ExploreMobileSearchState>) {
                        const action = attrs.action || `/${window.I18n.locale}/explore?ref=ctrse_explore_pgsearch&filter=all`
                        const method = attrs.method || 'GET'
                        const searchParam = state.searchParam
                
                
                Severity: Minor
                Found in legacy/src/c/explore/explore-mobile-search.tsx - About 1 hr to fix

                  Function loadProjects has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private loadProjects(model, parameters : Object = {}) : ViewModel<Project> {
                          model.pageSize(9);
                          if (this._searchParam) {
                              return new SinglePageViewModel(async () => {
                                  const projectsFound = await this.makeProjectsSearch()
                  Severity: Minor
                  Found in legacy/src/vms/projects-explore-vm.ts - About 1 hr to fix

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

                        oninit: function(vnode) {
                            const userDetails = prop(vnode.attrs.user_details || {}),
                                user_id = vnode.attrs.user_id.split('-')[0],
                                hash = prop(window.location.hash),
                                displayTabContent = (user) => {
                    Severity: Minor
                    Found in legacy/src/root/users-show.js - About 1 hr to fix

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

                          oninit: function(vnode) {
                              vnode.state = {
                                  actions: {
                                      reset: {
                                          property: 'password',
                      Severity: Minor
                      Found in legacy/src/c/admin-user-detail.js - About 1 hr to fix

                        Function safeVal has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const safeVal = (value, $target, cardNumberProp) => {
                            let currPair,
                                cursor,
                                digit,
                                error,
                        Severity: Minor
                        Found in legacy/src/vms/credit-card-vm.js - About 1 hr to fix

                          Function compareObjects_ has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) {
                            if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) {
                              return true;
                            }
                          
                          
                          Severity: Minor
                          Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

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

                                oninit: function(vnode) {
                                    const subscription = vnode.attrs.subscription,
                                        reward = prop(),
                                        toggleDetails = h.toggleProp(false, true),
                                        user = prop(vnode.attrs.user);
                            Severity: Minor
                            Found in legacy/src/c/dashboard-subscription-card.js - About 1 hr to fix

                              Function validate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  validate = () => {
                                      const errorFields = prop([]);
                              
                                      return {
                                          submit(fields, fn) {
                              Severity: Minor
                              Found in legacy/src/h.ts - About 1 hr to fix

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

                                    view({ attrs, state } : m.Vnode<InputFindLocationAttrs, InputFindLocationState>) {
                                        const cities = state.cities
                                        const searchCities = state.searchCities
                                        const hasCitiesToDisplay = cities && cities.length > 0
                                        const onSelect = state.onSelect
                                Severity: Minor
                                Found in legacy/src/c/std/input-find-location.tsx - About 1 hr to fix

                                  Function sendNotification has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                              sendNotification = (e) => {
                                                  e.preventDefault();
                                                  isLoading(true);
                                  
                                                  const notificationData = {
                                  Severity: Minor
                                  Found in legacy/src/c/posts-preview.js - About 1 hr to fix

                                    Function reportSpecResults has 29 lines of code (exceeds 25 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';
                                    Severity: Minor
                                    Found in legacy/spec/lib/jasmine/jasmine-html.js - About 1 hr to fix

                                      Function renderComponent has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        function renderComponent(component, treePath) {
                                          if (isFunction(component.tag)) {
                                            component.instance = component.tag(component)
                                          } else if (isClass(component.tag)) {
                                            const Component = component.tag
                                      Severity: Minor
                                      Found in legacy/spec/lib/mithril-query/mithril-query.js - About 1 hr to fix

                                        Function checkPermalinkAvailable has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                state.checkPermalinkAvailable = async (inputText) => {
                                                    let lastValidValue = state.currentPermalink
                                                    state.currentPermalink = inputText
                                                    try {
                                                        const projectBySlugRequestConfig = {
                                        Severity: Minor
                                        Found in legacy/src/c/projects/publish-by-steps/input-permalink.tsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language