assemblymade/meta

View on GitHub

Showing 446 of 1,255 total issues

File d3.v2.js has 7026 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function() {
  function d3_class(ctor, properties) {
    try {
      for (var key in properties) {
        Object.defineProperty(ctor.prototype, key, {
Severity: Major
Found in app/assets/javascripts/admin/d3.v2.js - About 2 wks to fix

    File masonry.pkgd.js has 1624 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * Masonry PACKAGED v3.1.2
     * Cascading grid layout library
     * http://masonry.desandro.com
     * MIT License
    Severity: Major
    Found in app/assets/javascripts/lib/masonry.pkgd.js - About 4 days to fix

      File jquery.magnific-popup.js has 1398 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*! Magnific Popup - v1.0.0 - 2015-01-03
      * http://dimsemenov.com/plugins/magnific-popup/
      * Copyright (c) 2015 Dmitry Semenov; */
      ;(function (factory) { 
      if (typeof define === 'function' && define.amd) { 
      Severity: Major
      Found in app/assets/javascripts/lib/jquery.magnific-popup.js - About 3 days to fix

        File focus_home.js has 1393 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*!
        * Masonry PACKAGED v3.1.5
        * Cascading grid layout library
        * http://masonry.desandro.com
        * MIT License
        Severity: Major
        Found in app/assets/javascripts/focus_home.js - About 3 days to fix

          Function outlayerDefinition has 484 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function outlayerDefinition( eventie, docReady, EventEmitter, getSize, matchesSelector, Item ) {
          
          // -------------------------- Outlayer -------------------------- //
          
          // globally unique identifiers
          Severity: Major
          Found in app/assets/javascripts/lib/masonry.pkgd.js - About 2 days to fix

            Class Product has 112 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class Product < ActiveRecord::Base
              include ActiveRecord::UUID
              include Kaminari::ActiveRecordModelExtension
              include Elasticsearch::Model
              include GlobalID::Identification
            Severity: Major
            Found in app/models/product.rb - About 2 days to fix

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

                render: function() {
                  var background = 'linear-gradient(160deg, rgba(255, 232, 80, .8), rgba(26, 88, 131, .85) 70%), url(' + this.props.mastheadUrl + ')';
                  return (
                    <div className="mt0 mb3">
                      <div className="masthead" style={{background: background, paddingTop: 0}}>
              Severity: Major
              Found in app/assets/javascripts/components/start_page.js.jsx - About 1 day to fix

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

                  render: function() {
                    var background = 'linear-gradient(160deg, rgba(255, 232, 80, .8), rgba(26, 88, 131, .85) 70%), url(' + this.props.mastheadUrl + ')';
                    return (
                      <div className="mt0 mb3">
                        <div className="masthead" style={{background: background, paddingTop: 0}}>
                Severity: Major
                Found in app/assets/javascripts/components/import_page.js.jsx - About 1 day to fix

                  Function outlayerItemDefinition has 295 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function outlayerItemDefinition( EventEmitter, getSize, getStyleProperty ) {
                  
                  // -------------------------- CSS3 support -------------------------- //
                  
                  var transitionProperty = getStyleProperty('transition');
                  Severity: Major
                  Found in app/assets/javascripts/lib/masonry.pkgd.js - About 1 day to fix

                    Function d3_voronoi_tessellate has 268 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function d3_voronoi_tessellate(vertices, callback) {
                        var Sites = {
                          list: vertices.map(function(v, i) {
                            return {
                              index: i,
                    Severity: Major
                    Found in app/assets/javascripts/admin/d3.v2.js - About 1 day to fix

                      File product.rb has 607 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      require 'money'
                      require './lib/poster_image'
                      require 'elasticsearch/model'
                      
                      class Product < ActiveRecord::Base
                      Severity: Major
                      Found in app/models/product.rb - About 1 day to fix

                        File routes.js has 590 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        // This is a generated file, to regen run:
                        // rake js:routes
                        
                        var exports = module.exports = {};
                        exports.api_org_bounties_path = function(options){
                        Severity: Major
                        Found in app/assets/javascripts/routes.js - About 1 day to fix

                          File jquery.autocomplete.js has 572 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /**
                          *  Ajax Autocomplete for jQuery, version 1.2.7
                          *  (c) 2013 Tomas Kirda
                          *
                          *  Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
                          Severity: Major
                          Found in app/assets/javascripts/lib/jquery.autocomplete.js - About 1 day to fix

                            Class User has 64 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            class User < ActiveRecord::Base
                              include ActiveRecord::UUID
                              include Elasticsearch::Model
                              include GlobalID::Identification
                              include Kaminari::ActiveRecordModelExtension
                            Severity: Major
                            Found in app/models/user.rb - About 1 day to fix

                              Function brush has 213 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                d3.svg.brush = function() {
                                  function brush(g) {
                                    g.each(function() {
                                      var g = d3.select(this), bg = g.selectAll(".background").data([ 0 ]), fg = g.selectAll(".extent").data([ 0 ]), tz = g.selectAll(".resize").data(resizes, String), e;
                                      g.style("pointer-events", "all").on("mousedown.brush", brushstart).on("touchstart.brush", brushstart);
                              Severity: Major
                              Found in app/assets/javascripts/admin/d3.v2.js - About 1 day to fix

                                Function force has 210 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  d3.layout.force = function() {
                                    function repulse(node) {
                                      return function(quad, x1, y1, x2, y2) {
                                        if (quad.point !== node) {
                                          var dx = quad.cx - node.x, dy = quad.cy - node.y, dn = 1 / Math.sqrt(dx * dx + dy * dy);
                                Severity: Major
                                Found in app/assets/javascripts/admin/d3.v2.js - About 1 day to fix

                                  Function draw has 191 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    draw: function(id, d, options){
                                    var cfg = {
                                     radius: 5,
                                     w: 600,
                                     h: 600,
                                  Severity: Major
                                  Found in app/assets/javascripts/d3/user_radar.js - About 7 hrs to fix

                                    Class Wip has 51 methods (exceeds 20 allowed). Consider refactoring.
                                    Open

                                    class Wip < ActiveRecord::Base
                                      include ActiveRecord::UUID
                                      include Elasticsearch::Model
                                      include Kaminari::ActiveRecordModelExtension
                                      include Workflow
                                    Severity: Major
                                    Found in app/models/wip.rb - About 7 hrs to fix

                                      Method response_times has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        def self.response_times(product:, time: Time.now)
                                      
                                          response_times = { "core" => [], "noncore" => [], "comments_count" => 0 }
                                      
                                          # need to join on NFIs since comments are now attached to those
                                      Severity: Minor
                                      Found in app/models/product_metric.rb - About 6 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

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

                                      'use strict';
                                      
                                      const App = require('../app.js.jsx')
                                      const AppIcon = require('../app_icon.js.jsx')
                                      const BountyCard = require('../bounty_card.js.jsx')
                                      Severity: Minor
                                      Found in app/assets/javascripts/components/dashboard/dashboard_index.js.jsx - About 6 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language