estimancy/projestimate

View on GitHub

Showing 1,675 of 1,675 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        function drawScale() {

            //X axis line                                                          

            ctx.lineWidth = config.scaleLineWidth;
Severity: Major
Found in app/assets/javascripts/ChartNew.js and 1 other location - About 3 days to fix
app/assets/javascripts/ChartNew.js on lines 3384..3433

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 622.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method create_organization_from_image has a Cognitive Complexity of 176 (exceeds 5 allowed). Consider refactoring.
Open

  def create_organization_from_image
    authorize! :manage, Organization

    case params[:action_name]
      #Duplicate organization
Severity: Minor
Found in app/controllers/organizations_controller.rb - About 3 days 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 Endpoint has 701 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    jsPlumb.Endpoint = function(params) {
        var self = this, 
            _jsPlumb = params["_jsPlumb"],
            jpcl = jsPlumb.CurrentLibrary,
            _att = jpcl.getAttribute,
Severity: Major
Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 3 days to fix

    Method execute_duplication has a Cognitive Complexity of 162 (exceeds 5 allowed). Consider refactoring.
    Open

      def execute_duplication(project_id, new_organization_id)
        #begin
          old_prj = Project.find(project_id)
          new_organization = Organization.find(new_organization_id)
    
    
    Severity: Minor
    Found in app/controllers/organizations_controller.rb - About 3 days 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 execute_duplication has a Cognitive Complexity of 162 (exceeds 5 allowed). Consider refactoring.
    Open

      def execute_duplication(project_id, new_organization_id, user_id)
    
        user = User.find(user_id)
    
        #begin
    Severity: Minor
    Found in app/workers/organization_duplicate_project_worker.rb - About 3 days 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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        ts.addWidget({
            id: 'saveSort',
            priority: 20,
            options: {
                saveSort : true
    Severity: Major
    Found in app/assets/javascripts/pager.js and 1 other location - About 3 days to fix
    app/assets/javascripts/tablesorter.min.js on lines 1994..2049

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 526.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        ts.addWidget({
            id: 'saveSort',
            priority: 20,
            options: {
                saveSort : true
    Severity: Major
    Found in app/assets/javascripts/tablesorter.min.js and 1 other location - About 3 days to fix
    app/assets/javascripts/pager.js on lines 2840..2895

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 526.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function spectrum has 597 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function spectrum(element, o) {
    
            var opts = instanceOptions(o, element),
                flat = opts.flat,
                showSelectionPalette = opts.showSelectionPalette,
    Severity: Major
    Found in app/assets/javascripts/spectrum.js - About 2 days to fix

      Function color has 565 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          color : function(target, prop) {
      
      
              this.required = true; // refuse empty values?
              this.adjust = true; // adjust value to uniform notation?
      Severity: Major
      Found in app/assets/javascripts/jscolor.js - About 2 days to fix

        File bootstrap-datepicker.js has 1091 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // ################################# BOOTSTRAP DATE PICKER #################################
        
        /* =========================================================
         * bootstrap-datepicker.js
         * http://www.eyecon.ro/bootstrap-datepicker
        Severity: Major
        Found in app/assets/javascripts/bootstrap-datepicker.js - About 2 days to fix

          File jit-2.0.1-excanvas.js has 1084 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // Copyright 2006 Google Inc.
          //
          // Licensed under the Apache License, Version 2.0 (the "License");
          // you may not use this file except in compliance with the License.
          // You may obtain a copy of the License at
          Severity: Major
          Found in app/assets/javascripts/jit-2.0.1-excanvas.js - About 2 days to fix

            Method display_inputs_with_activities has a Cognitive Complexity of 113 (exceeds 5 allowed). Consider refactoring.
            Open

              def display_inputs_with_activities(module_project, last_estimation_result=nil)
                pbs_project_element = current_component
                res = String.new
                if module_project.compatible_with(current_component.work_element_type.alias)# || current_component
                  pemodule = Pemodule.find(module_project.pemodule.id)
            Severity: Minor
            Found in app/helpers/projects_helper.rb - About 2 days 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 projects_helper.rb has 899 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module ProjectsHelper
            
              # This helper method will display Estimation Result according the estimation purpose (PBS and/or Activities)
              def display_results
                res = String.new
            Severity: Major
            Found in app/helpers/projects_helper.rb - About 2 days to fix

              Method execute_duplication_SAVE has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring.
              Open

                def execute_duplication_SAVE(project_id, new_organization_id, user_id)
              
                  user = User.find(user_id)
              
                  #begin
              Severity: Minor
              Found in app/workers/organization_duplicate_project_worker.rb - About 2 days 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 organizations_controller.rb has 852 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              class OrganizationsController < ApplicationController
                load_resource
                require 'rubygems'
                require 'securerandom'
                include ProjectsHelper
              Severity: Major
              Found in app/controllers/organizations_controller.rb - About 2 days to fix

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                            if(config.xAxisTop || config.xAxisBottom) {                                                    
                              ctx.textBaseline = "top";
                              if (msr.rotateLabels > 90) {
                                  ctx.save();
                                  ctx.textAlign = "left";
                Severity: Major
                Found in app/assets/javascripts/ChartNew.js and 1 other location - About 2 days to fix
                app/assets/javascripts/ChartNew.js on lines 3147..3176

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 361.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                            if(config.xAxisTop || config.xAxisBottom) {                                                    
                              ctx.textBaseline = "top";
                              if (msr.rotateLabels > 90) {
                                  ctx.save();
                                  ctx.textAlign = "left";
                Severity: Major
                Found in app/assets/javascripts/ChartNew.js and 1 other location - About 2 days to fix
                app/assets/javascripts/ChartNew.js on lines 3722..3751

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 361.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                        function getValueBounds() {
                            var upperValue = Number.MIN_VALUE;
                            var lowerValue = Number.MAX_VALUE;
                            for (var i = 0; i < data.datasets.length; i++) {
                                for (var j = 0; j < data.datasets[i].data.length; j++) {
                Severity: Major
                Found in app/assets/javascripts/ChartNew.js and 2 other locations - About 2 days to fix
                app/assets/javascripts/ChartNew.js on lines 2505..2533
                app/assets/javascripts/ChartNew.js on lines 3488..3516

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 356.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                        function getValueBounds() {
                            var upperValue = Number.MIN_VALUE;
                            var lowerValue = Number.MAX_VALUE;
                            for (var i = 0; i < data.datasets.length; i++) {
                                for (var j = 0; j < data.datasets[i].data.length; j++) {
                Severity: Major
                Found in app/assets/javascripts/ChartNew.js and 2 other locations - About 2 days to fix
                app/assets/javascripts/ChartNew.js on lines 2505..2533
                app/assets/javascripts/ChartNew.js on lines 3771..3799

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 356.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                        function getValueBounds() {
                            var upperValue = Number.MIN_VALUE;
                            var lowerValue = Number.MAX_VALUE;
                            for (var i = 0; i < data.datasets.length; i++) {
                                for (var j = 0; j < data.datasets[i].data.length; j++) {
                Severity: Major
                Found in app/assets/javascripts/ChartNew.js and 2 other locations - About 2 days to fix
                app/assets/javascripts/ChartNew.js on lines 3488..3516
                app/assets/javascripts/ChartNew.js on lines 3771..3799

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 356.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Severity
                Category
                Status
                Source
                Language