concord-consortium/lara

View on GitHub

Showing 830 of 830 total issues

Function tablesorter has 1356 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        tablesorter: new function() {

            var ts = this;

            ts.version = "2.18.3";
Severity: Major
Found in app/assets/javascripts/tablesorter.js - About 6 days to fix

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

    describe("useInteractiveState", () => {
      it("returns current interactive state", async () => {
        const { result, waitForNextUpdate } = renderHook(() => hooks.useInteractiveState<any>());
    
        expect(result.current.interactiveState).toEqual(null);
    Severity: Major
    Found in lara-typescript/src/interactive-api-client/hooks.spec.tsx and 2 other locations - About 5 days to fix
    lara-typescript/src/interactive-api-client/hooks.spec.tsx on lines 121..196
    lara-typescript/src/interactive-api-client/hooks.spec.tsx on lines 198..273

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

    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 3 locations. Consider refactoring.
    Open

    describe("useGlobalInteractiveState", () => {
      it("returns current global interactive state", async () => {
        const { result, waitForNextUpdate } = renderHook(() => hooks.useGlobalInteractiveState<any>());
    
        expect(result.current.globalInteractiveState).toEqual(null);
    Severity: Major
    Found in lara-typescript/src/interactive-api-client/hooks.spec.tsx and 2 other locations - About 5 days to fix
    lara-typescript/src/interactive-api-client/hooks.spec.tsx on lines 44..119
    lara-typescript/src/interactive-api-client/hooks.spec.tsx on lines 121..196

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

    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 3 locations. Consider refactoring.
    Open

    describe("useAuthoredState", () => {
      it("returns current authored state", async () => {
        const { result, waitForNextUpdate } = renderHook(() => hooks.useAuthoredState<any>());
    
        expect(result.current.authoredState).toEqual(null);
    Severity: Major
    Found in lara-typescript/src/interactive-api-client/hooks.spec.tsx and 2 other locations - About 5 days to fix
    lara-typescript/src/interactive-api-client/hooks.spec.tsx on lines 44..119
    lara-typescript/src/interactive-api-client/hooks.spec.tsx on lines 198..273

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

    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

    },{"./structured-clone":4}],2:[function(require,module,exports){
    var ParentEndpoint = require('./parent-endpoint');
    var getIFrameEndpoint = require('./iframe-endpoint');
    
    // Not a real UUID as there's an RFC for that (needed for proper distributed computing).
    Severity: Major
    Found in public/demo-interactives/iframe-phone.js and 1 other location - About 4 days to fix
    app/assets/javascripts/iframe-phone.js on lines 153..243

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

    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

      },{"./structured-clone":4}],2:[function(require,module,exports){
      var ParentEndpoint = require('./parent-endpoint');
      var getIFrameEndpoint = require('./iframe-endpoint');
    
      // Not a real UUID as there's an RFC for that (needed for proper distributed computing).
    Severity: Major
    Found in app/assets/javascripts/iframe-phone.js and 1 other location - About 4 days to fix
    public/demo-interactives/iframe-phone.js on lines 141..231

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

    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

    File tablesorter.js has 1550 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**!
    * TableSorter (FORK) 2.18.3 - Client-side table sorting with ease!
    * @requires jQuery v1.2.6+
    *
    * Copyright (c) 2007 Christian Bach
    Severity: Major
    Found in app/assets/javascripts/tablesorter.js - About 4 days to fix

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

      (function($) {
          'use strict';
      
          $.jCarousel.plugin('jcarouselControl', {
              _options: {
      Severity: Major
      Found in app/assets/javascripts/jquery.jcarousel-control.js and 1 other location - About 3 days to fix
      app/assets/javascripts/jquery.jcarousel.js on lines 1084..1156

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

      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($) {
          'use strict';
      
          $.jCarousel.plugin('jcarouselControl', {
              _options: {
      Severity: Major
      Found in app/assets/javascripts/jquery.jcarousel.js and 1 other location - About 3 days to fix
      app/assets/javascripts/jquery.jcarousel-control.js on lines 4..76

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

      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

      File hammer.js has 1376 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*! Hammer.JS - v2.0.4 - 2014-09-28
       * http://hammerjs.github.io/
       *
       * Copyright (c) 2014 Jorik Tangelder;
       * Licensed under the MIT license */
      Severity: Major
      Found in app/assets/javascripts/hammer.js - About 3 days to fix

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

        /*! jCarousel - v0.3.1 - 2014-04-26
        * http://sorgalla.com/jcarousel
        * Copyright (c) 2014 Jan Sorgalla; Licensed MIT */
        (function($) {
            'use strict';
        Severity: Major
        Found in app/assets/javascripts/jquery.jcarousel.js - About 2 days to fix

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

          /*jslint browser: true, sloppy: true, todo: true, devel: true, white: true */
          /*global $ */
          /* [CC] This file has been modified substantially from its original version,
              so updating to a newer version of the library would be non-trivial. */
          /*!
          Severity: Major
          Found in app/assets/javascripts/jquery.colorbox.js - About 2 days to fix

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

              it("should show/hide incorrect alert", () => {
                const uuid = "incorrect-alert";
                expect(api.hasModal(uuid)).toBe(false);
                expect($(".ui-dialog").length).toBe(0);
                const showOptions: IShowModal = { uuid, type: "alert", style: "incorrect" };
            lara-typescript/src/interactive-api-lara-host/modal-api-plugin.spec.ts on lines 18..31

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

            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

              it("should show/hide correct alert", () => {
                const uuid = "correct-alert";
                expect(api.hasModal(uuid)).toBe(false);
                expect($(".ui-dialog").length).toBe(0);
                const showOptions: IShowModal = { uuid, type: "alert", style: "correct" };
            lara-typescript/src/interactive-api-lara-host/modal-api-plugin.spec.ts on lines 33..46

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

            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 3 locations. Consider refactoring.
            Open

              it("should show/hide modal iframe lightbox with size", done => {
                const uuid = "iframe-lightbox-size";
                expect($("#colorbox").length).toBe(0);
                expect(api.hasModal(uuid)).toBe(false);
                const showOptions: IShowModal = { uuid, type: "lightbox", url: "https://concord.org",
            lara-typescript/src/interactive-api-lara-host/modal-api-plugin.spec.ts on lines 153..171
            lara-typescript/src/interactive-api-lara-host/modal-api-plugin.spec.ts on lines 173..191

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

            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 3 locations. Consider refactoring.
            Open

              it("should show/hide tall modal iframe lightbox with size", done => {
                const uuid = "iframe-lightbox-tall";
                expect($("#colorbox").length).toBe(0);
                expect(api.hasModal(uuid)).toBe(false);
                const showOptions: IShowModal = { uuid, type: "lightbox", url: "https://concord.org",
            lara-typescript/src/interactive-api-lara-host/modal-api-plugin.spec.ts on lines 133..151
            lara-typescript/src/interactive-api-lara-host/modal-api-plugin.spec.ts on lines 153..171

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

            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 3 locations. Consider refactoring.
            Open

              it("should show/hide wide modal iframe lightbox with size", done => {
                const uuid = "iframe-lightbox-wide";
                expect($("#colorbox").length).toBe(0);
                expect(api.hasModal(uuid)).toBe(false);
                const showOptions: IShowModal = { uuid, type: "lightbox", url: "https://concord.org",
            lara-typescript/src/interactive-api-lara-host/modal-api-plugin.spec.ts on lines 133..151
            lara-typescript/src/interactive-api-lara-host/modal-api-plugin.spec.ts on lines 173..191

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

            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(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.iframePhone=e():"undefined"!=typeof global?global.iframePhone=e():"undefined"!=typeof self&&(self.iframePhone=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
            var structuredClone = require('./structured-clone');
            var HELLO_INTERVAL_LENGTH = 200;
            var HELLO_TIMEOUT_LENGTH = 60000;
            
            
            Severity: Major
            Found in public/demo-interactives/iframe-phone.js and 1 other location - About 1 day to fix
            app/assets/javascripts/iframe-phone.js on lines 7..481

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

            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(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.iframePhone=e():"undefined"!=typeof global?global.iframePhone=e():"undefined"!=typeof self&&(self.iframePhone=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
              var structuredClone = require('./structured-clone');
              var HELLO_INTERVAL_LENGTH = 200;
              var HELLO_TIMEOUT_LENGTH = 60000;
            
            
            Severity: Major
            Found in app/assets/javascripts/iframe-phone.js and 1 other location - About 1 day to fix
            public/demo-interactives/iframe-phone.js on lines 1..463

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

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

            export const CustomizeManagedInteractive: React.FC<Props> = (props) => {
              const { managedInteractive, libraryInteractive, defaultClickToPlayPrompt } = props;
              const {
                inherit_aspect_ratio_method,
                custom_aspect_ratio_method,
              Severity
              Category
              Status
              Source
              Language