ciudadanointeligente/vizard

View on GitHub

Showing 74 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

    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

        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

          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

            Function _getValue has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
            Open

                '_getValue':function(obj, transform, key,index) {
                    
                    var out = '';
                    
                    var val = transform[key];
            Severity: Minor
            Found in app/assets/javascripts/json2html.js - About 4 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 projects_controller.rb has 321 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            class ProjectsController < ApplicationController
              before_action :authenticate_user!
              before_action :set_project, only: [:show, :edit, :update, :destroy, :solutions, :public, :stage1, :stage2, :share, :overview]
            
              respond_to :html, :json
            Severity: Minor
            Found in app/controllers/projects_controller.rb - About 3 hrs to fix

              Function setDivContent has 92 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  setDivContent: function(cell, content) {
                      var the_date = '';
                      if( this.has('date'))
                          the_date = this.get("date")
              
              
              Severity: Major
              Found in app/assets/javascripts/bpmn.js - About 3 hrs to fix

                Function openIHF has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                Open

                function openIHF(cellView, edit){
                
                    var model = cellView.model
                
                    var btn_sidebar_right = "#btn-inspector-container",
                Severity: Minor
                Found in app/assets/javascripts/bpmn.js - 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

                Function _tokenizer has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                Open

                    '_tokenizer':function( tokenizers, doBuild ){
                
                        if( !(this instanceof json2html._tokenizer ) )
                            return new json2html._tokenizer( tokenizers, doBuild );
                            
                Severity: Minor
                Found in app/assets/javascripts/json2html.js - 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

                Function _apply has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    '_apply':function(obj, transform, index, options) {
                
                        var element = {'events':[],'html':''};
                        
                        //Itterate through the transform and create html as needed
                Severity: Major
                Found in app/assets/javascripts/json2html.js - About 2 hrs to fix

                  Function createBinding has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function createBinding(keyCombo, keyDownCallback, keyUpCallback) {
                          var api = {}, binding, subBindings = [], bindingApi = {}, kI,
                          subCombo;
                  
                          //break the combo down into a combo array
                  Severity: Major
                  Found in app/assets/javascripts/keyboard.js - About 2 hrs to fix

                    Method link_text has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def link_text element_symbol
                        case element_symbol
                        when :real_problem
                          @real_problem.blank? ? 'Articulate the real-world problem children are facing that you want to address' : (@real_problem.title != "." ? @real_problem.title : 'Articulate the real-world problem children are facing that you want to address')
                        when :policy_problems
                    Severity: Minor
                    Found in app/helpers/projects_helper.rb - About 2 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

                    Function parseKeyCombo has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function parseKeyCombo(keyCombo) {
                            var s = keyCombo, i = 0, op = 0, ws = false, nc = false, combos = [], combo = [], stage = [], key = '';
                    
                            if(typeof keyCombo === 'object' && typeof keyCombo.push === 'function') { return keyCombo; }
                            if(typeof keyCombo !== 'string') { throw new Error('Cannot parse "keyCombo" because its type is "' + (typeof keyCombo) + '". It must be a "string".'); }
                    Severity: Major
                    Found in app/assets/javascripts/keyboard.js - About 2 hrs to fix

                      Method objective_link_text has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def objective_link_text objective, element_symbol
                          case element_symbol
                          when :actors
                            objective.actors.blank? ? "List actors and power map" : " #{objective.actors.size} Actors"
                          when :enabling_factors
                      Severity: Minor
                      Found in app/helpers/projects_helper.rb - About 2 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 stage1_controller.js has 251 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      app.controller("stage1Ctrl", ["$scope", "$http", "$aside", "$location", "$attrs", function ($scope, $http, $aside, $location, $attrs) {
                        $scope.project_id = $location.path().split("/")[2];
                        $scope.messages = {response: "", message: ""}
                        $http.get('/real_problems/focus_area.json')
                          .success(function (data) {
                      Severity: Minor
                      Found in app/assets/javascripts/angular_files/stage1_controller.js - About 2 hrs to fix

                        Function _tokenizer has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            '_tokenizer':function( tokenizers, doBuild ){
                        
                                if( !(this instanceof json2html._tokenizer ) )
                                    return new json2html._tokenizer( tokenizers, doBuild );
                                    
                        Severity: Minor
                        Found in app/assets/javascripts/json2html.js - About 1 hr to fix

                          Function position has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                              position: function(p) {
                          
                                  var bbox;
                          
                                  if (p) {
                          Severity: Minor
                          Found in app/assets/javascripts/bpmn.js - 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