concord-consortium/lara

View on GitHub

Showing 418 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

    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

      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

            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,

              File mock-api-provider.ts has 605 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { findItemAddress, findItemByAddress } from "../util/finding-utils";
              import { setSectionPositions, updatePositions } from "../util/move-utils";
              import {
                IPage, PageId,
                APIPageGetF, APIPagesGetF, APIPageItemUpdateF,
              Severity: Major
              Found in lara-typescript/src/section-authoring/api/mock-api-provider.ts - About 1 day to fix

                File api.spec.ts has 553 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { mockIFramePhone, MockPhone } from "../interactive-api-lara-host/mock-iframe-phone";
                import * as iframePhone from "iframe-phone";
                import * as api from "./api";
                import { getClient } from "./client";
                import {
                Severity: Major
                Found in lara-typescript/src/interactive-api-client/api.spec.ts - About 1 day to fix

                  File iframe-saver.ts has 533 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { ParentEndpoint } from "iframe-phone";
                  import * as DOMPurify from "dompurify";
                  import { IframePhoneManager } from "./iframe-phone-manager";
                  import { IFrameSaverPluginApi } from "./iframe-saver-plugin";
                  import { ModalApiPlugin } from "./modal-api-plugin";
                  Severity: Major
                  Found in lara-typescript/src/interactive-api-lara-host/iframe-saver.ts - About 1 day to fix

                    Function ShutterbugWorker has 218 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            var ShutterbugWorker = function () {
                              function ShutterbugWorker(options) {
                                _classCallCheck(this, ShutterbugWorker);
                    
                                var opt = options || {};
                    Severity: Major
                    Found in app/assets/javascripts/shutterbug.js - About 1 day to fix

                      Function usePageAPI has 211 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const usePageAPI = () => {
                      
                        const { userInterface, actions } = useContext(UserInterfaceContext);
                        const provider: IAuthoringAPIProvider = useContext(APIContext);
                        const client = useQueryClient(); // Get the context from our container.
                      Severity: Major
                      Found in lara-typescript/src/section-authoring/hooks/use-api-provider.ts - About 1 day to fix

                        Function CustomizeMWInteractive has 197 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const CustomizeMWInteractive: React.FC<Props> = (props) => {
                          const {
                            checkboxHandler,
                            defaultClickToPlayPrompt,
                            enableLearnerStateRef,
                        Severity: Major
                        Found in lara-typescript/src/page-item-authoring/mw-interactives/customize.tsx - About 7 hrs to fix

                          Function usePageAPI has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export const usePageAPI = () => {
                          
                            const { userInterface, actions } = useContext(UserInterfaceContext);
                            const provider: IAuthoringAPIProvider = useContext(APIContext);
                            const client = useQueryClient(); // Get the context from our container.
                          Severity: Minor
                          Found in lara-typescript/src/section-authoring/hooks/use-api-provider.ts - About 7 hrs to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function SectionItemPicker has 189 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const SectionItemPicker: React.FC<IProps> = (props) => {
                            const api = usePageAPI();
                            const allItems = useMemo(() => {
                              if (!api.getAllEmbeddables.data) {
                                return undefined;

                            File types.ts has 448 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import { IEventListeners } from "../plugin-api";
                            
                            // Export some shared types.
                            export { IPortalClaims, IJwtClaims, IJwtResponse } from "../shared/types";
                            
                            
                            Severity: Minor
                            Found in lara-typescript/src/interactive-api-shared/types.ts - About 6 hrs to fix

                              Method set_linked_interactives has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def set_linked_interactives(options)
                                  source_page_item_id = id
                              
                                  ActiveRecord::Base.transaction do
                                    if options.has_key?("linkedInteractives")
                              Severity: Minor
                              Found in app/models/page_item.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

                              File interactive_pages_controller.rb has 446 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              class Api::V1::InteractivePagesController < API::APIController
                                layout false
                                before_filter :set_interactive_page, except: [
                                  :get_library_interactives_list,
                                  :get_wrapping_plugins_list,
                              Severity: Minor
                              Found in app/controllers/api/v1/interactive_pages_controller.rb - About 6 hrs to fix

                                File eventemitter2.js has 427 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                /*!
                                 * EventEmitter2
                                 * https://github.com/hij1nx/EventEmitter2
                                 *
                                 * Copyright (c) 2013 hij1nx
                                Severity: Minor
                                Found in app/assets/javascripts/eventemitter2.js - About 6 hrs to fix

                                  Function bindMethods has 156 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                              function bindMethods(table){
                                                  var c = table.config,
                                                      $table = c.$table;
                                                  // apply easy methods that trigger bound events
                                                  $table
                                  Severity: Major
                                  Found in app/assets/javascripts/tablesorter.js - About 6 hrs to fix

                                    Method generate has 152 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      def self.generate(arg_block_buckets)
                                        bucket_columns = arg_block_buckets[:columns].map &:to_sym
                                        bucket_rows = arg_block_buckets[:rows]
                                        bucket_row_indices = indices_by_element(bucket_columns)
                                    
                                    
                                    Severity: Major
                                    Found in app/services/c_rater/argumentation_blocks_report.rb - About 6 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language