SysMO-DB/seek

View on GitHub

Showing 1,025 of 1,025 total issues

File javascript.js has 470 lines of code (exceeds 250 allowed). Consider refactoring.
Open

function Position(x, y)
{
  this.X = x;
  this.Y = y;
  
Severity: Minor
Found in app/assets/javascripts/jws/Resizeable_Textbox/javascript.js - About 7 hrs to fix

    File javascript.js has 459 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    function Position(x, y)
    {
      this.X = x;
      this.Y = y;
      
    Severity: Minor
    Found in app/assets/javascripts/jws/Resizeable_Container/javascript.js - About 7 hrs to fix

      File models_controller.rb has 452 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'libxml'
      require 'bives'
      
      class ModelsController < ApplicationController
      
      
      Severity: Minor
      Found in app/controllers/models_controller.rb - About 6 hrs to fix

        File assays.js has 450 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var sops_assets=new Array();
        var models_assets=new Array();
        var data_files_assets=new Array();
        var organisms = new Array();
        var assays_array = new Array();
        Severity: Minor
        Found in app/assets/javascripts/assays.js - About 6 hrs to fix

          File application_controller.rb has 449 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'authenticated_system'
          
          class ApplicationController < ActionController::Base
          
            include Seek::Errors::ControllerErrorHandling
          Severity: Minor
          Found in app/controllers/application_controller.rb - About 6 hrs to fix

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

                            for (var index = 0; index < elesNotInDragLayer.length; index++) {
                                element = elesNotInDragLayer[index];
            
                                if (element._private.group == "nodes") {
                                    r.drawNodeText(context, element);
            Severity: Major
            Found in app/assets/javascripts/modified_cytoscape.js and 1 other location - About 6 hrs to fix
            app/assets/javascripts/modified_cytoscape.js on lines 677..692

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

            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

                            for (var index = 0; index < elesInDragLayer.length; index++) {
                                element = elesInDragLayer[index];
            
                                if (element._private.group == "nodes") {
                                    r.drawNodeText(context, element);
            Severity: Major
            Found in app/assets/javascripts/modified_cytoscape.js and 1 other location - About 6 hrs to fix
            app/assets/javascripts/modified_cytoscape.js on lines 609..624

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

            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(e.pageY >= (sheet.position().top + sheet.outerHeight()) - slowScrollBoundary)
                                if(e.pageY >= (sheet.position().top + sheet.outerHeight()) - fastScrollBoundary)
                                    yInc =  "+=50px";
                                else
                                    yInc =  "+=10px";
            Severity: Major
            Found in app/assets/javascripts/spreadsheet_explorer.js and 1 other location - About 6 hrs to fix
            app/assets/javascripts/spreadsheet_explorer.js on lines 122..133

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

            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(e.pageX >= (sheet.position().left + sheet.outerWidth()) - slowScrollBoundary)
                                if(e.pageX >= (sheet.position().left + sheet.outerWidth()) - fastScrollBoundary)
                                    xInc =  "+=50px";
                                else
                                    xInc =  "+=10px";
            Severity: Major
            Found in app/assets/javascripts/spreadsheet_explorer.js and 1 other location - About 6 hrs to fix
            app/assets/javascripts/spreadsheet_explorer.js on lines 109..120

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

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

                def dictionary_definition
                  # in the future this could be moved out to a file
                  { refresh: 'famfamfam_silk/arrow_refresh_small.png',
                    arrow_up: 'famfamfam_silk/arrow_up.png',
                    arrow_down: 'famfamfam_silk/arrow_down.png',
            Severity: Major
            Found in lib/seek/image_file_dictionary.rb - About 6 hrs to fix

              Function Position has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
              Open

              function Position(x, y)
              {
                this.X = x;
                this.Y = y;
                
              Severity: Minor
              Found in app/assets/javascripts/jws/Resizeable_Container/javascript.js - About 6 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 Position has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
              Open

              function Position(x, y)
              {
                this.X = x;
                this.Y = y;
                
              Severity: Minor
              Found in app/assets/javascripts/jws/Resizeable_Textbox/javascript.js - About 6 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 extended_xml has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
              Open

                def extended_xml builder,object        
                  
                  submitter = determine_submitter object
                  builder.tag! "submitter" do 
                    api_partial(builder,submitter)
              Severity: Minor
              Found in app/helpers/api_helper.rb - About 6 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 log_event has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
              Open

                def log_event
                  User.with_current_user current_user do
                    c = self.controller_name.downcase
                    a = self.action_name.downcase
              
              
              Severity: Minor
              Found in app/controllers/application_controller.rb - About 6 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 prototype has 160 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Searcher.prototype = new function() {
                // search is performed in chunks of 1000 for non-blocking user input
                var CHUNK_SIZE = 1000;
                // do not try to find more than 100 results
                var MAX_RESULTS = 100;
              Severity: Major
              Found in doc/seek/js/searcher.js - About 6 hrs to fix

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

                    for (var i=0;i<assays_array.length;i++) {
                        assay=assays_array[i];
                        title=assay[0];
                        id=assay[1];
                        relationshipType = assay[2];
                Severity: Major
                Found in app/assets/javascripts/assays.js and 1 other location - About 6 hrs to fix
                app/assets/javascripts/assays.js on lines 168..178

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

                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

                    for (var i=0;i<data_files_assets.length;i++) {        
                        data_file=data_files_assets[i];
                        title=data_file[0];
                        id=data_file[1];
                        relationshipType = data_file[2];
                Severity: Major
                Found in app/assets/javascripts/assays.js and 1 other location - About 6 hrs to fix
                app/assets/javascripts/assays.js on lines 334..344

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

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

                  def tree_editor_display type, show_edit=true, show_delete=true, selected_id=nil, related_resource_type="Person",selective_display=false, foldable=false
                
                    selected_display_items = nil
                
                    if selected_id && selective_display
                Severity: Minor
                Found in app/helpers/projects_helper.rb - About 6 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

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

                function addSelectedSop() {
                    selected_option_index=$("possible_sops").selectedIndex;
                    selected_option=$("possible_sops").options[selected_option_index];
                    title=selected_option.text;
                    id=selected_option.value;
                Severity: Major
                Found in app/assets/javascripts/assays.js and 1 other location - About 5 hrs to fix
                app/assets/javascripts/assays.js on lines 216..234

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

                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 addSelectedModel() {
                    selected_option_index=$("possible_models").selectedIndex;
                    selected_option=$("possible_models").options[selected_option_index];
                    title=selected_option.text;
                    id=selected_option.value;
                Severity: Major
                Found in app/assets/javascripts/assays.js and 1 other location - About 5 hrs to fix
                app/assets/javascripts/assays.js on lines 53..73

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

                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