assemblymade/meta

View on GitHub

Showing 446 of 1,255 total issues

Function open has 160 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        open: function(data) {

            if(!_body) {
                _body = $(document.body);
            }
Severity: Major
Found in app/assets/javascripts/focus_home.js - About 6 hrs to fix

    Function open has 157 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        open: function(data) {
    
            var i;
    
            if(data.isObj === false) { 
    Severity: Major
    Found in app/assets/javascripts/lib/jquery.magnific-popup.js - About 6 hrs to fix

      Function path has 151 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        d3.geo.path = function() {
          function path(d, i) {
            if (typeof pointRadius === "function") pointCircle = d3_path_circle(pointRadius.apply(this, arguments));
            pathType(d);
            var result = buffer.length ? buffer.join("") : null;
      Severity: Major
      Found in app/assets/javascripts/admin/d3.v2.js - About 6 hrs to fix

        File start_page.js.jsx has 402 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var Accordion = require('./ui/accordion.js.jsx');
        var Spinner = require('./spinner.js.jsx');
        var TextPost = require('./ui/text_post.js.jsx')
        var Tile = require('./ui/tile.js.jsx')
        var Button = require('./ui/button.js.jsx')
        Severity: Minor
        Found in app/assets/javascripts/components/start_page.js.jsx - About 5 hrs to fix

          Function treemap has 140 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            d3.layout.treemap = function() {
              function scale(children, k) {
                var i = -1, n = children.length, child, area;
                while (++i < n) {
                  area = (child = children[i]).value * (k < 0 ? 0 : k);
          Severity: Major
          Found in app/assets/javascripts/admin/d3.v2.js - About 5 hrs to fix

            File user.rb has 392 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'activerecord/uuid'
            require 'avatar'
            require 'stripe'
            
            class User < ActiveRecord::Base
            Severity: Minor
            Found in app/models/user.rb - About 5 hrs to fix

              File news_feed_item_comments.js.jsx has 387 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              // TODO This lib is in application.js (chrislloyd)
              // var marked = require('marked')
              
              var ActivityFeedComment = require('../activity_feed_comment.js.jsx');
              var BountyStore = require('../../stores/bounty_store');

                Function axis has 127 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  d3.svg.axis = function() {
                    function axis(g) {
                      g.each(function() {
                        var g = d3.select(this);
                        var ticks = tickValues == null ? scale.ticks ? scale.ticks.apply(scale, tickArguments_) : scale.domain() : tickValues, tickFormat = tickFormat_ == null ? scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments_) : String : tickFormat_;
                Severity: Major
                Found in app/assets/javascripts/admin/d3.v2.js - About 5 hrs to fix

                  Class Idea has 38 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Idea < ActiveRecord::Base
                    include ActiveRecord::UUID
                    include Kaminari::ActiveRecordModelExtension
                  
                    extend FriendlyId
                  Severity: Minor
                  Found in app/models/idea.rb - About 5 hrs to fix

                    Function zoom has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      d3.behavior.zoom = function() {
                        function zoom() {
                          this.on("mousedown.zoom", mousedown).on("mousewheel.zoom", mousewheel).on("mousemove.zoom", mousemove).on("DOMMouseScroll.zoom", mousewheel).on("dblclick.zoom", dblclick).on("touchstart.zoom", touchstart).on("touchmove.zoom", touchmove).on("touchend.zoom", touchstart);
                        }
                        function location(p) {
                    Severity: Major
                    Found in app/assets/javascripts/admin/d3.v2.js - About 4 hrs to fix

                      File import_page.js.jsx has 371 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      var Accordion = require('./ui/accordion.js.jsx');
                      var Spinner = require('./spinner.js.jsx');
                      var TextPost = require('./ui/text_post.js.jsx')
                      var Tile = require('./ui/tile.js.jsx')
                      var Button = require('./ui/button.js.jsx')
                      Severity: Minor
                      Found in app/assets/javascripts/components/import_page.js.jsx - About 4 hrs to fix

                        File news_feed_item.js.jsx has 367 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        'use strict';
                        
                        const ActivityFeedComment = require('../activity_feed_comment.js.jsx');
                        const AppIcon = require('../app_icon.js.jsx');
                        const ArchivedNewsFeedItemsStore = require('../../stores/archived_news_feed_items_store');
                        Severity: Minor
                        Found in app/assets/javascripts/components/news_feed/news_feed_item.js.jsx - About 4 hrs to fix

                          Function CanvasRenderer has 114 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          var CanvasRenderer = function(el, options) {
                              var cachedBackground;
                              var canvas = document.createElement('canvas');
                          
                              el.appendChild(canvas);
                          Severity: Major
                          Found in app/assets/javascripts/lib/jquery.easypiechart.js - About 4 hrs to fix

                            File bounty.js.jsx has 355 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            'use strict';
                            
                            const AvatarWithUsername = require('./ui/avatar_with_username.js.jsx');
                            const BountyActionCreators = require('../actions/bounty_actions');
                            const BountyStore = require('../stores/bounty_store');
                            Severity: Minor
                            Found in app/assets/javascripts/components/bounty.js.jsx - About 4 hrs to fix

                              Function chord has 111 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                d3.layout.chord = function() {
                                  function relayout() {
                                    var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j;
                                    chords = [];
                                    groups = [];
                              Severity: Major
                              Found in app/assets/javascripts/admin/d3.v2.js - About 4 hrs to fix

                                Function renderPageButtons has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  renderPageButtons() {
                                    var currentPage = this.state.currentPage;
                                    var maxPages = this.props.maxPages;
                                    var totalPages = this.state.totalPages;
                                
                                
                                Severity: Minor
                                Found in app/assets/javascripts/components/pagination/pagination.js.jsx - About 4 hrs 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 constructor has 108 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  constructor() {
                                    super()
                                
                                    this.dispatchToken = Dispatcher.register((action) => {
                                      switch(action.type) {
                                Severity: Major
                                Found in app/assets/javascripts/stores/love_store.js - About 4 hrs to fix

                                  Function value has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      value: function(target, firstSource) {
                                        "use strict";
                                        if (target === undefined || target === null)
                                          throw new TypeError("Cannot convert first argument to object");
                                  
                                  
                                  Severity: Minor
                                  Found in app/assets/javascripts/polyfills.js - About 4 hrs 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 brushstart has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function brushstart() {
                                        function mouse() {
                                          var touches = d3.event.changedTouches;
                                          return touches ? d3.touches(target, touches)[0] : d3.mouse(target);
                                        }
                                  Severity: Major
                                  Found in app/assets/javascripts/admin/d3.v2.js - About 4 hrs to fix

                                    Function dispatchToken has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        this.dispatchToken = Dispatcher.register((action) => {
                                          switch(action.type) {
                                            case ActionTypes.COMMENT_ADDED:
                                              var comment = action.data
                                              _heartables[comment.id] = {
                                    Severity: Major
                                    Found in app/assets/javascripts/stores/love_store.js - About 4 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language