discourse/discourse

View on GitHub

Showing 2,941 of 3,748 total issues

Function createProperties has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  createProperties() {
    const types = this.web_hook_event_types;
    const categoryIds = this.categories.map(c => c.id);
    const tagNames = this.tag_names;

Severity: Minor
Found in app/assets/javascripts/admin/models/web-hook.js - About 1 hr to fix

    Function setCacheNameDetails has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const setCacheNameDetails = details => {
        {
          Object.keys(details).forEach(key => {
            finalAssertExports.isType(details[key], 'string', {
              moduleName: 'workbox-core',
    Severity: Minor
    Found in public/javascripts/workbox/workbox-core.dev.js - About 1 hr to fix

      Function next has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        StringIterator.prototype.next = function next() {
          if (!(this instanceof StringIterator))
            throw new TypeError(
              "Method String Iterator.prototype.next called on incompatible receiver " +
                String(this)
      Severity: Minor
      Found in plugins/discourse-unsupported-browser/public/js/ie.js - About 1 hr to fix

        Function submit has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            submit() {
              if (!this.formSubmitted) {
                this.set("formSubmitted", true);
                const screenedIpAddress = ScreenedIpAddress.create({
                  ip_address: this.ip_address,
        Severity: Minor
        Found in app/assets/javascripts/admin/components/screened-ip-address-form.js - About 1 hr to fix

          Function getMatcher has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            getMatcher() {
              if (this.matcher) {
                return this.matcher;
              }
          
          

            Function cantSubmitPost has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              cantSubmitPost(
                loading,
                canEditTitle,
                titleLength,
                targetRecipients,
            Severity: Minor
            Found in app/assets/javascripts/discourse/app/models/composer.js - About 1 hr to fix

              Function fillGapBefore has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                fillGapBefore(post, gap) {
                  const postId = post.get("id"),
                    stream = this.stream,
                    idx = stream.indexOf(postId),
                    currentPosts = this.posts;
              Severity: Minor
              Found in app/assets/javascripts/discourse/app/models/post-stream.js - About 1 hr to fix

                Function initialize has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  initialize(container) {
                    // Tell our AJAX system to track a page transition
                    const router = container.lookup("router:main");
                
                    router.on("routeWillChange", viewTrackingRequired);
                Severity: Minor
                Found in app/assets/javascripts/discourse/app/initializers/page-tracking.js - About 1 hr to fix

                  Function asJSON has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    asJSON() {
                      const attrs = {
                        name: this.name,
                        mentionable_level: this.mentionable_level,
                        messageable_level: this.messageable_level,
                  Severity: Minor
                  Found in app/assets/javascripts/discourse/app/models/group.js - About 1 hr to fix

                    Function fromText has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      fromText(filterType, opts) {
                        const anonymous = !User.current();
                    
                        opts = opts || {};
                    
                    
                    Severity: Minor
                    Found in app/assets/javascripts/discourse/app/models/nav-item.js - About 1 hr to fix

                      Function findBySlug has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        findBySlug(slug, parentSlug) {
                          const categories = Category.list();
                          let category;
                      
                          if (parentSlug) {
                      Severity: Minor
                      Found in app/assets/javascripts/discourse/app/models/category.js - About 1 hr to fix

                        Function popupMenuOptions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          popupMenuOptions(composeState) {
                            if (composeState === "open" || composeState === "fullscreen") {
                              const options = [];
                        
                              options.push(
                        Severity: Minor
                        Found in app/assets/javascripts/discourse/app/controllers/composer.js - About 1 hr to fix

                          Function _showUrl has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            _showUrl($target, url) {
                              const $currentTargetOffset = $target.offset();
                              const $this = $(this.element);
                          
                              if (isEmpty(url)) {
                          Severity: Minor
                          Found in app/assets/javascripts/discourse/app/components/share-popup.js - About 1 hr to fix

                            Function click has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              click(e) {
                                // Mobile basic-topic-list doesn't use the `topic-list-item` view so
                                // the event for the topic entrance is never wired up.
                                if (!this.site.mobileView) {
                                  return;
                            Severity: Minor
                            Found in app/assets/javascripts/discourse/app/components/basic-topic-list.js - About 1 hr to fix

                              Function _performCheckSize has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                _performCheckSize() {
                                  if (!this.element || this.isDestroying || this.isDestroyed) {
                                    return;
                                  }
                              
                              
                              Severity: Minor
                              Found in app/assets/javascripts/discourse/app/components/topic-navigation.js - About 1 hr to fix

                                Function completeTerm has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  var completeTerm = function(term) {
                                    if (term) {
                                      if (isInput) {
                                        me.val("");
                                        if (options.single) {
                                Severity: Minor
                                Found in app/assets/javascripts/discourse/app/lib/autocomplete.js - About 1 hr to fix

                                  Function _init has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    _init() {
                                      this.setProperties({
                                        searchedTerms: {
                                          username: "",
                                          category: "",

                                    Function lock has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      lock() {
                                        const startedAt = Date.now();
                                        let previousTop = this.elementTop();
                                        previousTop && $(window).scrollTop(previousTop);
                                    
                                    
                                    Severity: Minor
                                    Found in app/assets/javascripts/discourse/app/lib/lock-on.js - About 1 hr to fix

                                      Function selectedText has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export function selectedText() {
                                        const selection = window.getSelection();
                                        if (selection.isCollapsed) {
                                          return "";
                                        }
                                      Severity: Minor
                                      Found in app/assets/javascripts/discourse/app/lib/utilities.js - About 1 hr to fix

                                        Function interceptClick has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export default function interceptClick(e) {
                                          if (wantsNewWindow(e)) {
                                            return;
                                          }
                                        
                                        
                                        Severity: Minor
                                        Found in app/assets/javascripts/discourse/app/lib/intercept-click.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language