estimancy/projestimate

View on GitHub

Showing 836 of 1,675 total issues

Function _applyStyles has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _applyStyles = function(node, style, component, _jsPlumb) {
        var styleToWrite = {};
        if (style.strokeStyle) {
            styleToWrite["stroked"] = "true";
            var strokeColor = jsPlumbUtil.convertStyle(style.strokeStyle, true);
Severity: Minor
Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

    Function buildHeaders has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                function buildHeaders(table) {
                    var header_index = computeThIndexes(table), ch, $t,
                        h, i, t, lock, time, c = table.config;
                    c.headerList = [];
                    c.headerContent = [];
    Severity: Minor
    Found in app/assets/javascripts/pager.js - About 1 hr to fix

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

        initialize: function(controller) {
          var $ForceDirected = $jit.ForceDirected;
      
          var config = {
            iterations: 50,
      Severity: Minor
      Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

        Function addHeaderResizeEvent has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            ts.addHeaderResizeEvent = function(table, disable, settings) {
                table = $(table)[0]; // make sure we're usig a dom element
                var headers,
                    defaults = {
                        timer : 250
        Severity: Minor
        Found in app/assets/javascripts/tablesorter.min.js - About 1 hr to fix

          Function checkFilters has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  checkFilters: function(table, filter, skipFirst) {
                      var c = table.config,
                          wo = c.widgetOptions,
                          filterArray = $.isArray(filter),
                          filters = (filterArray) ? filter : ts.getFilters(table, true),
          Severity: Minor
          Found in app/assets/javascripts/tablesorter.min.js - About 1 hr to fix

            Function plot has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

               plot: function(opt, animating) {
                 var viz = this.viz, 
                     aGraph = viz.graph, 
                     canvas = viz.canvas, 
                     id = viz.root, 
            Severity: Minor
            Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

              Function paint has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      this.paint = function(params, containerExtents) {
                          var p = {}, d = params.d, connector = params.component;
                          if (params.strokeStyle) {
                              p["stroked"] = "true";
                              p["strokecolor"] = jsPlumbUtil.convertStyle(params.strokeStyle, true);                    
              Severity: Minor
              Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

                Function toString has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        toString: function(format) {
                            var formatSet = !!format;
                            format = format || this._format;
                
                            var formattedString = false;
                Severity: Minor
                Found in app/assets/javascripts/spectrum.js - About 1 hr to fix

                  Function populate has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          populate : function(model, values) {        
                              // for a string, see if it has parameter matches, and if so, try to make the substitutions.
                              var getValue = function(fromString) {
                                      var matches = fromString.match(/(\${.*?})/g);
                                      if (matches != null) {
                  Severity: Minor
                  Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

                    Function _initDraggableIfNecessary has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            _initDraggableIfNecessary = function(element, isDraggable, dragOptions) {
                                // TODO move to DragManager?
                                if (!jsPlumbAdapter.headless) {
                                    var draggable = isDraggable == null ? false : isDraggable, jpcl = jsPlumb.CurrentLibrary;
                                    if (draggable) {
                    Severity: Minor
                    Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

                      Function set_placeholder has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          fn.set_placeholder = function(col, row) {
                              var phgd = $.extend({}, this.placeholder_grid_data);
                              var $nexts = this.widgets_below({
                                      col: phgd.col,
                                      row: phgd.row,
                      Severity: Minor
                      Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                        Function PolarArea has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            this.PolarArea = function (data, options) {
                        
                                chart.PolarArea.defaults = {
                                    scaleOverlay: true,
                                    scaleOverride: false,
                        Severity: Minor
                        Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

                          Function calculateDrawingSize has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  function calculateDrawingSize() {
                          
                                      var lgtxt;
                          
                                      var cumulativeAngle = -config.startAngle * (Math.PI / 180)+2*Math.PI ,
                          Severity: Minor
                          Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

                            Function calculateDrawingSize has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    function calculateDrawingSize() {
                            
                                        var lgtxt;
                                        var cumulativeAngle = -config.startAngle * (Math.PI / 180)+2*Math.PI ,
                                           cumvalue = 0;
                            Severity: Minor
                            Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

                              Method results has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def results
                                  #No authorize required since everyone can search
                                  if params[:search].class == Array
                                    classes = params[:search][:classes].map { |i| String::keep_clean_space(i).camelcase.constantize }
                                  else
                              Severity: Minor
                              Found in app/controllers/searches_controller.rb - About 1 hr to fix

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

                                  def self.update_master_data!
                                    db=Home::connect_external_database
                                    puts 'Updating from Master Data...'
                                
                                    #begin
                                Severity: Minor
                                Found in app/models/home.rb - About 1 hr 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

                                Method update_install has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def update_install
                                  #No authorize required
                                  begin
                                      expire_fragment('about_page')
                                
                                
                                Severity: Minor
                                Found in app/controllers/homes_controller.rb - About 1 hr 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

                                Method display_results has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def display_results
                                    res = String.new
                                    unless @project.nil?
                                      #pbs_project_element = @pbs_project_element || @project.root_component
                                      pbs_project_element = @pbs_project_element || current_component
                                Severity: Minor
                                Found in app/helpers/projects_helper.rb - About 1 hr 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

                                Method display_value has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def display_value(value, est_val, mp_id)
                                    module_project = ModuleProject.find(mp_id)
                                    est_val_pe_attribute = est_val.pe_attribute
                                    precision = est_val_pe_attribute.precision.nil? ? user_number_precision : est_val_pe_attribute.precision
                                    if est_val_pe_attribute.alias == "retained_size" || est_val_pe_attribute.alias == "theorical_size"
                                Severity: Minor
                                Found in app/helpers/projects_helper.rb - About 1 hr 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

                                Method set_element_value_with_activities has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def set_element_value_with_activities(estimation_result, module_project)
                                    authorize! :execute_estimation_plan, @project
                                
                                    result_with_consistency = Hash.new
                                    consistency = true
                                Severity: Minor
                                Found in app/controllers/projects_controller.rb - About 1 hr 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