SysMO-DB/seek

View on GitHub

Showing 1,025 of 1,025 total issues

Function roundRectangleIntersectLine has 97 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    canvas_prototype.roundRectangleIntersectLine = function(
        x, y, nodeX, nodeY, width, height, padding) {

        //Manually change for seek to fix that safari quits unexpectedly
        var cornerRadius = 0;
Severity: Major
Found in app/assets/javascripts/modified_cytoscape.js - About 3 hrs to fix

    Method add_as_new has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def add_as_new resource
          #FIXME: this method is too long 
          begin
            warning=nil
            warning_code=0
    Severity: Minor
    Found in lib/jerm/embedded_populator.rb - 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

    Method build_all_bio_sample_json has 92 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def build_all_bio_sample_json sheet
    
          # population order should NOT change, DB is populated only if @to_populate is set to be true
    
          # probing number of rows with data in sheet
    Severity: Major
    Found in lib/seek/data/bio_samples.rb - About 3 hrs to fix

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

              {
                  var topStartX = nodeX - halfWidth + cornerRadius - padding;
                  var topStartY = nodeY - halfHeight - padding;
                  var topEndX = nodeX + halfWidth - cornerRadius + padding;
                  var topEndY = topStartY;
      Severity: Major
      Found in app/assets/javascripts/modified_cytoscape.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/modified_cytoscape.js on lines 354..366

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

      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

              {
                  var rightStartX = nodeX + halfWidth + padding;
                  var rightStartY = nodeY - halfHeight + cornerRadius - padding;
                  var rightEndX = rightStartX;
                  var rightEndY = nodeY + halfHeight - cornerRadius + padding;
      Severity: Major
      Found in app/assets/javascripts/modified_cytoscape.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/modified_cytoscape.js on lines 369..381

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

      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

              {
                  var bottomStartX = nodeX - halfWidth + cornerRadius - padding;
                  var bottomStartY = nodeY + halfHeight + padding;
                  var bottomEndX = nodeX + halfWidth - cornerRadius + padding;
                  var bottomEndY = bottomStartY;
      Severity: Major
      Found in app/assets/javascripts/modified_cytoscape.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/modified_cytoscape.js on lines 324..336

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

      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

              {
                  var leftStartX = nodeX - halfWidth - padding;
                  var leftStartY = nodeY - halfHeight + cornerRadius - padding;
                  var leftEndX = leftStartX;
                  var leftEndY = nodeY + halfHeight - cornerRadius + padding;
      Severity: Major
      Found in app/assets/javascripts/modified_cytoscape.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/modified_cytoscape.js on lines 339..351

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

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

        def text_or_not_specified text, options = {}
          text=text.to_s if text.kind_of?(Numeric)
          if text.nil? or text.chomp.empty?
            not_specified_text||=options[:none_text]
            not_specified_text||="No description specified" if options[:description]==true
      Severity: Minor
      Found in app/helpers/application_helper.rb - 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

      Method generate_triples has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

            def generate_triples subject, method, property,uri_or_literal,transformation,collection_transform,rdf_graph
              resource = subject.rdf_resource
              transform = transformation.strip unless transformation.nil?
              collection_transform = collection_transform.strip unless collection_transform.nil?
              items = subject.send(method)
      Severity: Minor
      Found in lib/seek/rdf/rdf_generation.rb - 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

      Method handle_upload_data has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

            def handle_upload_data
              blob_params = content_blob_params
      
              # MERGENOTE - the manipulation and validation of the params still needs a bit of cleaning up
              blob_params = update_params_for_batch(blob_params)
      Severity: Minor
      Found in lib/seek/upload_handling/data_upload.rb - 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

      Method populate_specimen has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          def populate_specimen specimen_json
      
            specimen_title = specimen_json["title"]
            sex = specimen_json["sex"]
            age = specimen_json["age"]
      Severity: Minor
      Found in lib/seek/data/bio_samples.rb - 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

      Method populate_treatment has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          def populate_treatment treatment_json, specimen=nil, sample=nil
      
              start_value = treatment_json["start value"]
              end_value = treatment_json["end value"]
              standard_deviation = treatment_json["standard deviation"]
      Severity: Minor
      Found in lib/seek/data/bio_samples.rb - 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 dragObject has 89 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function dragObject(element, attachElement, lowerBound, upperBound, startCallback, moveCallback, endCallback, attachLater)
      {
        if(typeof(element) == "string")
          element = document.getElementById(element);
        if(element == null)
      Severity: Major
      Found in app/assets/javascripts/jws/Resizeable_Textbox/javascript.js - About 3 hrs to fix

        Function dragObject has 89 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function dragObject(element, attachElement, lowerBound, upperBound, startCallback, moveCallback, endCallback, attachLater)
        {
          if(typeof(element) == "string")
            element = document.getElementById(element);
          if(element == null)
        Severity: Major
        Found in app/assets/javascripts/jws/Resizeable_Container/javascript.js - About 3 hrs to fix

          File data_files_controller.rb has 313 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'simple-spreadsheet-extractor'
          
          class DataFilesController < ApplicationController
          
            include IndexPager
          Severity: Minor
          Found in app/controllers/data_files_controller.rb - About 3 hrs to fix

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

            function addSelectedDiscipline() {
                selected_option_index=$("possible_disciplines").selectedIndex
                selected_option=$("possible_disciplines").options[selected_option_index]
                title=selected_option.text    
                id=selected_option.value
            Severity: Major
            Found in app/assets/javascripts/people.js and 1 other location - About 3 hrs to fix
            app/assets/javascripts/projects.js on lines 5..19

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

            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

            function addSelectedOrganism() {
                selected_option_index=$("possible_organisms").selectedIndex
                selected_option=$("possible_organisms").options[selected_option_index]
                title=selected_option.text
                id=selected_option.value
            Severity: Major
            Found in app/assets/javascripts/projects.js and 1 other location - About 3 hrs to fix
            app/assets/javascripts/people.js on lines 4..18

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

            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 (source == "target") {
                    if (allLinks[resource_type][id] == true){
                        checkedTargetMap[resource_type][id] = false;
                        allLinks[resource_type][id] = false;
                    } else {
            Severity: Major
            Found in app/assets/javascripts/link_adder.js and 1 other location - About 3 hrs to fix
            app/assets/javascripts/link_adder.js on lines 168..177

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

            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

                } else {
                    if (allLinks[resource_type][id] == true){
                        checkedSourceMap[resource_type][id] = false;
                        allLinks[resource_type][id] = false;
                    } else {
            Severity: Major
            Found in app/assets/javascripts/link_adder.js and 1 other location - About 3 hrs to fix
            app/assets/javascripts/link_adder.js on lines 159..168

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

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

                def populate_specimen specimen_json
            
                  specimen_title = specimen_json["title"]
                  sex = specimen_json["sex"]
                  age = specimen_json["age"]
            Severity: Major
            Found in lib/seek/data/bio_samples.rb - About 3 hrs to fix
              Severity
              Category
              Status
              Source
              Language