SysMO-DB/seek

View on GitHub

Showing 1,025 of 1,025 total issues

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

function Position(x, y)
{
  this.X = x;
  this.Y = y;
  
Severity: Major
Found in app/assets/javascripts/jws/Resizeable_Container/javascript.js and 1 other location - About 4 days to fix
app/assets/javascripts/jws/Resizeable_Textbox/javascript.js on lines 1..87

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

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

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

function Position(x, y)
{
  this.X = x;
  this.Y = y;
  
Severity: Major
Found in app/assets/javascripts/jws/Resizeable_Textbox/javascript.js and 1 other location - About 4 days to fix
app/assets/javascripts/jws/Resizeable_Container/javascript.js on lines 1..87

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

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

Identical blocks of code found in 2 locations. 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 and 1 other location - About 4 days to fix
app/assets/javascripts/jws/Resizeable_Textbox/javascript.js on lines 156..269

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

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

Identical blocks of code found in 2 locations. 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 and 1 other location - About 4 days to fix
app/assets/javascripts/jws/Resizeable_Container/javascript.js on lines 156..269

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

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

    $.fn.bxSlider = function(options){

        if(this.length == 0) return this;

        // support mutltiple elements
Severity: Major
Found in app/assets/javascripts/jquery.bxslider.js - About 3 days to fix

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

      function UpdatePositions()
      {
        if(_width < _minWidth)
          _width = _minWidth;
        if(_width > _maxWidth)
    Severity: Major
    Found in app/assets/javascripts/jws/Resizeable_Textbox/javascript.js and 1 other location - About 2 days to fix
    app/assets/javascripts/jws/Resizeable_Container/javascript.js on lines 399..428

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

    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 UpdatePositions2()
      {
        if(_width < _minWidth)
          _width = _minWidth;
        if(_width > _maxWidth)
    Severity: Major
    Found in app/assets/javascripts/jws/Resizeable_Container/javascript.js and 1 other location - About 2 days to fix
    app/assets/javascripts/jws/Resizeable_Textbox/javascript.js on lines 406..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 390.

    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 updateDisciplines() {
        discipline_text=''
        type="Discipline"
        discipline_ids=new Array();
    
    
    Severity: Major
    Found in app/assets/javascripts/people.js and 1 other location - About 2 days to fix
    app/assets/javascripts/projects.js on lines 33..78

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

    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 updateOrganisms() {
        organism_text=''
        type="Organism"
        organism_ids=new Array();
    
    
    Severity: Major
    Found in app/assets/javascripts/projects.js and 1 other location - About 2 days to fix
    app/assets/javascripts/people.js on lines 32..77

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

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

    function DropMenu1(id) {
    
        /* Type of the menu: "horizontal" or "vertical" */
        this.type = "horizontal";
    
    Severity: Minor
    Found in app/assets/javascripts/dropMenu.js - 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

    File bio_samples.rb has 800 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require "libxml"
    
    module Seek
      module Data
        class BioSamples
    Severity: Major
    Found in lib/seek/data/bio_samples.rb - About 1 day to fix

      File jquery.bxslider.js has 784 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * BxSlider v4.1.1 - Fully loaded, responsive content slider
       * http://bxslider.com
       *
       * Copyright 2013, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
      Severity: Major
      Found in app/assets/javascripts/jquery.bxslider.js - About 1 day to fix

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

        function model_type_selection_changed() {
            var selected=$('model_model_type_id');
            $('selected_model_type_id').value=selected.value
            if (selected.value)
            {        
        Severity: Major
        Found in app/assets/javascripts/models.js and 1 other location - About 1 day to fix
        app/assets/javascripts/models.js on lines 37..62

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

        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 model_format_selection_changed() {
            var selected=$('model_model_format_id');
            $('selected_model_format_id').value=selected.value
            if (selected.value)
            {
        Severity: Major
        Found in app/assets/javascripts/models.js and 1 other location - About 1 day to fix
        app/assets/javascripts/models.js on lines 10..35

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

        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 prototype has a Cognitive Complexity of 67 (exceeds 5 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: Minor
        Found in doc/seek/js/searcher.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

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

                function imageSwapZoomOut(curImage, newImage) {
                    $(curImage).css({'opacity':'1'});
                    $(newImage).css({'opacity':'0'});
                    $(newImage).css({'height':'250%', 'marginLeft':'-120px', 'marginTop':'-222px'});
                    $(curImage).css({'display':'inline'});
        Severity: Major
        Found in app/assets/javascripts/scales/scales.js and 1 other location - About 1 day to fix
        app/assets/javascripts/scales/scales.js on lines 59..89

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

        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 imageSwapZoomIn(curImage, newImage) {
                    $(curImage).css({'opacity':'1'});
                    $(newImage).css({'opacity':'0'});
                    $(newImage).css({'height':'25%', 'marginLeft':'200px', 'marginTop':'105px'});
                    $(curImage).css({'display':'inline'});
        Severity: Major
        Found in app/assets/javascripts/scales/scales.js and 1 other location - About 1 day to fix
        app/assets/javascripts/scales/scales.js on lines 91..119

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

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

            canvas_prototype.redraw = function( forcedContext, drawAll, forcedZoom, forcedPan ) {
                var r = this;
        
                if( this.averageRedrawTime === undefined ){ this.averageRedrawTime = 0; }
        
        
        Severity: Major
        Found in app/assets/javascripts/modified_cytoscape.js - About 1 day to fix

          File application_helper.rb has 573 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'savage_beast/application_helper'
          require 'app_version'
          
          module ApplicationHelper  
            include SavageBeast::ApplicationHelper
          Severity: Major
          Found in app/helpers/application_helper.rb - About 1 day to fix

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

            function ResizeableTextbox(id, parent)
            {
              var MINWIDTH = 125;
              var MINHEIGHT = 80;
              var MINSIZE = 38;
            Severity: Major
            Found in app/assets/javascripts/jws/Resizeable_Textbox/javascript.js - About 1 day to fix
              Severity
              Category
              Status
              Source
              Language