ciudadanointeligente/vizard

View on GitHub

Showing 182 of 182 total issues

File bpmn.js has 1568 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var inspector;

/* GRAPH */

var graph = new joint.dia.Graph({ type: 'bpmn' }).on({
Severity: Major
Found in app/assets/javascripts/bpmn.js - About 4 days to fix

    Method show has a Cognitive Complexity of 109 (exceeds 5 allowed). Consider refactoring.
    Open

      def show
        authorize @project
        @objectives = @project.objectives.where('prioritized = true')
        @a_size = 0
        @barriers_size = 0
    Severity: Minor
    Found in app/controllers/projects_controller.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

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

            if( (this.has('name') && this.get('name').length>0) || (this.has('description') && this.get('description').length>0) ) {
                var div = document.createElement("div");
                    div.className = 'joint-tooltip-content';
                var name = document.createElement("div");
                    name.className = 'joint-tooltip-strong';
    Severity: Major
    Found in app/assets/javascripts/bpmn.js and 1 other location - About 1 day to fix
    app/assets/javascripts/bpmn.js on lines 1162..1181

    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 346.

    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( (this.has('name') && this.get('name').length>0) || (this.has('description') && this.get('description').length>0) ) {
    
                var div = document.createElement("div");
                    div.className = 'joint-tooltip-content';
                var name = document.createElement("div");
    Severity: Major
    Found in app/assets/javascripts/bpmn.js and 1 other location - About 1 day to fix
    app/assets/javascripts/bpmn.js on lines 997..1016

    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 346.

    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 _apply has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
    Open

        '_apply':function(obj, transform, index, options) {
    
            var element = {'events':[],'html':''};
            
            //Itterate through the transform and create html as needed
    Severity: Minor
    Found in app/assets/javascripts/json2html.js - About 1 day 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 keyboard.js has 607 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Title: KeyboardJS
     * Version: v0.4.1
     * Description: KeyboardJS is a flexible and easy to use keyboard binding
     * library.
    Severity: Major
    Found in app/assets/javascripts/keyboard.js - About 1 day to fix

      File inspector.js has 552 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var inputs = {
      
          'bpmn.Gateway': {
              icon: {
                  type: 'select',
      Severity: Major
      Found in app/assets/javascripts/inspector.js - About 1 day to fix

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

            defaults: joint.util.deepSupplement({
        
                type: 'bpmn.Organization',
                bpmn_name: 'Organization',
                size: { width: 60, height: 60 },
        Severity: Major
        Found in app/assets/javascripts/bpmn.js and 1 other location - About 1 day to fix
        app/assets/javascripts/bpmn.js on lines 1389..1429

        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 213.

        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

            defaults: joint.util.deepSupplement({
        
                type: 'bpmn.MorePersons',
                bpmn_name: 'MorePersons',
                size: { width: 33, height: 33 },
        Severity: Major
        Found in app/assets/javascripts/bpmn.js and 1 other location - About 1 day to fix
        app/assets/javascripts/bpmn.js on lines 940..980

        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 213.

        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

            'bpmn.Intervention': {
                title: {
                    type: 'text',
                    label: 'Title',
                    group: 'general',
        Severity: Major
        Found in app/assets/javascripts/inspector.js and 1 other location - About 1 day to fix
        app/assets/javascripts/inspector.js on lines 397..435

        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 202.

        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

            'bpmn.External': {
                title: {
                    type: 'text',
                    label: 'Title',
                    group: 'general',
        Severity: Major
        Found in app/assets/javascripts/inspector.js and 1 other location - About 1 day to fix
        app/assets/javascripts/inspector.js on lines 437..475

        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 202.

        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

                el_zoomout.addEventListener('click', function(){
                    if( paperScroller._sy <= '1.2') {
                        graph.get('cells').each(function(cell) {
                            if(cell instanceof joint.shapes.bpmn.Person) {
                                cell.zoom_out();
        Severity: Major
        Found in app/assets/javascripts/vizard-extras.js and 1 other location - About 1 day to fix
        app/assets/javascripts/vizard-extras.js on lines 155..174

        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 196.

        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

                el_zoomin.addEventListener('click', function(){
                    if( paperScroller._sy > '1.2') {
                        graph.get('cells').each(function(cell) {
                            if(cell instanceof joint.shapes.bpmn.Person) {
                                cell.zoom_in();
        Severity: Major
        Found in app/assets/javascripts/vizard-extras.js and 1 other location - About 1 day to fix
        app/assets/javascripts/vizard-extras.js on lines 176..195

        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 196.

        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 show has 199 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def show
            authorize @project
            @objectives = @project.objectives.where('prioritized = true')
            @a_size = 0
            @barriers_size = 0
        Severity: Major
        Found in app/controllers/projects_controller.rb - About 7 hrs to fix

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

          joint.shapes.bpmn.Intervention = joint.shapes.bpmn.Step.extend({
              defaults: joint.util.deepSupplement({
          
                  type: 'bpmn.Intervention',
                  bpmn_name: 'Intervention',
          Severity: Major
          Found in app/assets/javascripts/bpmn.js and 1 other location - About 7 hrs to fix
          app/assets/javascripts/bpmn.js on lines 870..901

          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 193.

          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

          joint.shapes.bpmn.External = joint.shapes.bpmn.Step.extend({
              defaults: joint.util.deepSupplement({
          
                  type: 'bpmn.External',
                  bpmn_name: 'Internal Step',
          Severity: Major
          Found in app/assets/javascripts/bpmn.js and 1 other location - About 7 hrs to fix
          app/assets/javascripts/bpmn.js on lines 903..934

          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 193.

          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

            $scope.add_edit_enabling_factor = function (enabling_factor) {
                if(enabling_factor)
                  $scope.current_enabling_factor = enabling_factor;
                else
                  $scope.current_enabling_factor = "";
          Severity: Major
          Found in app/assets/javascripts/angular_files/stage3_controller.js and 1 other location - About 7 hrs to fix
          app/assets/javascripts/angular_files/stage3_controller.js on lines 196..219

          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 178.

          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

            $scope.add_edit_barrier = function (barrier) {
              if(barrier)
                $scope.current_barrier = barrier;
              else
                $scope.current_barrier = "";
          Severity: Major
          Found in app/assets/javascripts/angular_files/stage3_controller.js and 1 other location - About 7 hrs to fix
          app/assets/javascripts/angular_files/stage3_controller.js on lines 171..194

          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 178.

          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 openIHF has 170 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function openIHF(cellView, edit){
          
              var model = cellView.model
          
              var btn_sidebar_right = "#btn-inspector-container",
          Severity: Major
          Found in app/assets/javascripts/bpmn.js - About 6 hrs to fix

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

                    } else if (this.options.right) {
            
                        var $right = $(_.isFunction(this.options.right) ? this.options.right(this.$target[0]) : this.options.right);
                        var rightBbox = this.getElementBBox($right[0]);
                        this.$el.css({
            Severity: Major
            Found in app/assets/javascripts/bpmn.js and 1 other location - About 5 hrs to fix
            app/assets/javascripts/bpmn.js on lines 97..112

            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 146.

            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