Samhane/incubator-taverna-databundle-viewer

View on GitHub

Showing 21 of 54 total issues

Method to_dataHashObject has a Cognitive Complexity of 166 (exceeds 5 allowed). Consider refactoring.
Open

  def to_dataHashObject(bundle_filepath)

    nodes = []
    links = []

Severity: Minor
Found in app/models/provenance.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 sankey has 437 lines of code (exceeds 25 allowed). Consider refactoring.
Open

d3.sankey = function() {
  var sankey = {},
      nodeWidth = 24,
      nodePadding = 8,
      size = [1, 1],
Severity: Major
Found in app/assets/javascripts/sankey.js - About 2 days to fix

    Method to_dataHashObject has 248 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def to_dataHashObject(bundle_filepath)
    
        nodes = []
        links = []
    
    
    Severity: Major
    Found in app/models/provenance.rb - About 1 day to fix

      Function vertical_sankey has 239 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      d3.vertical_sankey = function() {
        var sankey = {},
            nodeWidth = 24,
            nodePadding = 8,
            size = [1, 1],
      Severity: Major
      Found in app/assets/javascripts/vertical_sankey.js - About 1 day to fix

        Function sankey has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
        Open

        d3.sankey = function() {
          var sankey = {},
              nodeWidth = 24,
              nodePadding = 8,
              size = [1, 1],
        Severity: Minor
        Found in app/assets/javascripts/sankey.js - About 7 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 sankey.js has 439 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // Copyright (c) 2012-2015, Michael Bostock,
        // Nathan Malkin, Kunal Bhalla, Claudiu Stefan Padurariu
        // All rights reserved.
        // 
        // Redistribution and use in source and binary forms, with or without
        Severity: Minor
        Found in app/assets/javascripts/sankey.js - About 6 hrs to fix

          File provenance.rb has 434 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'sparql'  # query the graph
          require 'uri'     # used to decode urls
          
          class Provenance
          
          
          Severity: Minor
          Found in app/models/provenance.rb - About 6 hrs to fix

            Function computeNodeBreadths has 86 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function computeNodeBreadths() {
            
                layerComponents();
            
                components.forEach(function(component, i){
            Severity: Major
            Found in app/assets/javascripts/sankey.js - About 3 hrs to fix

              Function computeNodeDepths has 82 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function computeNodeDepths(iterations) {
                  var nodesByBreadth = d3.nest()
                      .key(function(d) { return d.x; })
                      .sortKeys(d3.ascending)
                      .entries(nodes)
              Severity: Major
              Found in app/assets/javascripts/sankey.js - About 3 hrs to fix

                Function computeNodeDepths has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function computeNodeDepths(iterations) {
                    var nodesByBreadth = d3.nest()
                        .key(function(d) { return d.x; })
                        .sortKeys(d3.ascending)
                        .entries(nodes)
                Severity: Major
                Found in app/assets/javascripts/vertical_sankey.js - About 3 hrs to fix

                  Function reversibleLink has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    sankey.reversibleLink = function() {
                      var curvature = .5;
                  
                      // Used when source is behind target, the first and last paths are simple
                      // lines at the start and end node while the second path is the spline
                  Severity: Major
                  Found in app/assets/javascripts/sankey.js - About 3 hrs to fix

                    Method getAllArtifacts has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def getAllArtifacts
                        # create the query
                        sparql_query = SPARQL.parse("#{Provenance.prefixes}
                          SELECT *
                          WHERE
                    Severity: Major
                    Found in app/models/provenance.rb - About 2 hrs to fix

                      Function vertical_sankey has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                      Open

                      d3.vertical_sankey = function() {
                        var sankey = {},
                            nodeWidth = 24,
                            nodePadding = 8,
                            size = [1, 1],
                      Severity: Minor
                      Found in app/assets/javascripts/vertical_sankey.js - 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 backwardLink has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function backwardLink(part, d) {
                      
                            var curveExtension = 30;
                            var curveDepth = 15;
                      
                      
                      Severity: Minor
                      Found in app/assets/javascripts/sankey.js - About 1 hr to fix

                        Function computeNodeStructure has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function computeNodeStructure() {
                            var nodeStack = [], 
                                index = 0;
                        
                            nodes.forEach(function(node) {
                        Severity: Minor
                        Found in app/assets/javascripts/sankey.js - About 1 hr to fix

                          Method to_dataHashObject has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def to_dataHashObject
                              paths = []
                          
                              workflow.datalinks.each do |link|
                                paths << write_link(link, workflow) 
                          Severity: Minor
                          Found in app/decorators/data_bundle_decorator.rb - About 1 hr to fix

                            Method getAllProcessRuns has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def getAllProcessRuns
                                sparql_query = SPARQL.parse("#{Provenance.prefixes}   
                                  SELECT *
                                  WHERE
                                  { 
                            Severity: Minor
                            Found in app/models/provenance.rb - About 1 hr to fix

                              Function connect has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function connect(node) {
                                    node.index = index++;
                                    node.lowIndex = node.index;
                                    node.onStack = true;
                                    nodeStack.push(node);
                              Severity: Minor
                              Found in app/assets/javascripts/sankey.js - About 1 hr to fix

                                Method getAllWorkflowRuns has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def getAllWorkflowRuns
                                    # create the query
                                    sparql_query = SPARQL.parse("#{Provenance.prefixes}
                                      SELECT *
                                      WHERE
                                Severity: Minor
                                Found in app/models/provenance.rb - About 1 hr to fix

                                  Method to_dataHashObject has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def to_dataHashObject
                                      paths = []
                                  
                                      workflow.datalinks.each do |link|
                                        paths << write_link(link, workflow) 
                                  Severity: Minor
                                  Found in app/decorators/data_bundle_decorator.rb - About 45 mins 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