assemblymade/meta

View on GitHub

Showing 446 of 1,255 total issues

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

function masonryDefinition( Outlayer, getSize ) {
  // create an Outlayer layout class
  var Masonry = Outlayer.create('masonry');

  Masonry.prototype._resetLayout = function() {
Severity: Major
Found in app/assets/javascripts/lib/masonry.pkgd.js - About 4 hrs to fix

    Class Task has 33 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Task < Wip
      belongs_to :locker, class_name: 'User', foreign_key: 'locked_by'
    
      has_many :deliverables, foreign_key: 'wip_id'
      alias_method :design_deliverables, :deliverables
    Severity: Minor
    Found in app/models/task.rb - About 4 hrs to fix

      Function circle has 100 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        d3.geo.circle = function() {
          function circle() {}
          function visible(point) {
            return arc.distance(point) < radians;
          }
      Severity: Major
      Found in app/assets/javascripts/admin/d3.v2.js - About 4 hrs to fix

        Class QueryMarks has 32 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class QueryMarks
        
          INHERITED_TAGS_PRODUCTS_TO_WIPS = 0.04
          INHERITED_TAGS_WIPS_TO_PRODUCTS = 0.2
        
        
        Severity: Minor
        Found in app/models/query_marks.rb - About 4 hrs to fix

          Class ProductsController has 32 methods (exceeds 20 allowed). Consider refactoring.
          Open

          class ProductsController < ProductController
            respond_to :html, :json
          
            before_action :authenticate_user!, only: [:new, :create, :edit, :update, :follow, :unfollow, :announcements, :welcome]
            before_action :set_product,
          Severity: Minor
          Found in app/controllers/products_controller.rb - About 4 hrs to fix

            Function tree has 99 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              d3.layout.tree = function() {
                function tree(d, i) {
                  function firstWalk(node, previousSibling) {
                    var children = node.children, layout = node._tree;
                    if (children && (n = children.length)) {
            Severity: Major
            Found in app/assets/javascripts/admin/d3.v2.js - About 3 hrs to fix

              Function EasyPieChart has 95 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var EasyPieChart = function(el, opts) {
                  var defaultOptions = {
                      barColor: '#ef1e25',
                      trackColor: '#f9f9f9',
                      scaleColor: '#dfe0e0',
              Severity: Major
              Found in app/assets/javascripts/lib/jquery.easypiechart.js - About 3 hrs to fix

                Class FilterWipsQuery has 29 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class FilterWipsQuery
                  attr_accessor :product_wips, :user, :filters
                
                  def self.call(product_wips, user, filters)
                    new(product_wips, user, filters).filter_wips
                Severity: Minor
                Found in app/models/filter_wips_query.rb - About 3 hrs to fix

                  Class Transactions has 29 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                    class Transactions
                  
                      SATOSHIS=100_000_000
                  
                      def get_btc_balance(public_address)
                  Severity: Minor
                  Found in lib/open_assets/transactions.rb - About 3 hrs to fix

                    File products_controller.rb has 311 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    require 'timed_set'
                    require 'csv'
                    
                    OPEN_ASSETS_NAME_SHORT_CHAR_LIMIT = 10
                    
                    
                    Severity: Minor
                    Found in app/controllers/products_controller.rb - About 3 hrs to fix

                      Function data has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        d3_selectionPrototype.data = function(value, key) {
                          function bind(group, groupData) {
                            var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), n1 = Math.max(n, m), updateNodes = [], enterNodes = [], exitNodes = [], node, nodeData;
                            if (key) {
                              var nodeByKeyValue = new d3_Map, keyValues = [], keyValue, j = groupData.length;
                      Severity: Major
                      Found in app/assets/javascripts/admin/d3.v2.js - About 3 hrs to fix

                        Function tree has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function tree(d, i) {
                              function firstWalk(node, previousSibling) {
                                var children = node.children, layout = node._tree;
                                if (children && (n = children.length)) {
                                  var n, firstChild = children[0], previousChild, ancestor = firstChild, child, i = -1;
                        Severity: Major
                        Found in app/assets/javascripts/admin/d3.v2.js - About 3 hrs to fix

                          Function render has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            render() {
                              let product = this.state.product;
                              let slug = product.slug;
                              let user = UserStore.getUser();
                              let trust = null;
                          Severity: Major
                          Found in app/assets/javascripts/components/products/product_show.js.jsx - About 3 hrs to fix

                            Function defineGetSize has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function defineGetSize( getStyleProperty ) {
                            
                            // -------------------------- box sizing -------------------------- //
                            
                            var boxSizingProp = getStyleProperty('boxSizing');
                            Severity: Major
                            Found in app/assets/javascripts/lib/masonry.pkgd.js - About 3 hrs to fix

                              Class ApplicationController has 28 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                              class ApplicationController < ActionController::Base
                                protect_from_forgery with: :exception
                              
                                before_action :store_location
                                before_action :validate_confirmed!, if: :signed_in?
                              Severity: Minor
                              Found in app/controllers/application_controller.rb - About 3 hrs to fix

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

                                    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_;
                                        var subticks = d3_svg_axisSubdivide(scale, ticks, tickSubdivide), subtick = g.selectAll(".minor").data(subticks, String), subtickEnter = subtick.enter().insert("line", "g").attr("class", "tick minor").style("opacity", 1e-6), subtickExit = d3.transition(subtick.exit()).style("opacity", 1e-6).remove(), subtickUpdate = d3.transition(subtick).style("opacity", 1);
                                Severity: Major
                                Found in app/assets/javascripts/admin/d3.v2.js - About 3 hrs to fix

                                  Function initZoom has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                                                                  initZoom: function() {
                                                                                      var zoomSt = mfp.st.zoom,
                                                                                      ns = '.zoom',
                                                                                      image;
                                  
                                  
                                  Severity: Major
                                  Found in app/assets/javascripts/focus_home.js - About 3 hrs to fix

                                    Function initZoom has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            initZoom: function() {
                                                var zoomSt = mfp.st.zoom,
                                                    ns = '.zoom',
                                                    image;
                                                    
                                    Severity: Major
                                    Found in app/assets/javascripts/lib/jquery.magnific-popup.js - About 3 hrs to fix

                                      Function getImage has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              getImage: function(item, template) {
                                      
                                                  var guard = 0,
                                      
                                                      // image load complete handler
                                      Severity: Major
                                      Found in app/assets/javascripts/lib/jquery.magnific-popup.js - About 3 hrs to fix

                                        Method publish! has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                          def self.publish!(opts)
                                            bridge = opts.delete(:bridge)
                                            create!(opts).tap do |a|
                                              if a.publishable
                                                if Story.should_publish?(a)
                                        Severity: Minor
                                        Found in app/models/activity.rb - About 3 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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language