Showing 418 of 830 total issues
File shutterbug.js
has 417 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("jquery"));
else if(typeof define === 'function' && define.amd)
define(["jquery"], factory);
Function ManagedInteractiveAuthoring
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ManagedInteractiveAuthoring: React.FC<Props> = (props) => {
const {
libraryInteractive,
managedInteractive,
defaultClickToPlayPrompt,
Function getLibraryInteractives
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getLibraryInteractives = () => {
const libraryInteractives: ILibraryInteractive[] = [
{
id: 1,
serializeable_id: "LibraryInteractive_1",
Function load
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
function load () {
var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
active = true;
Function AuthoringSection
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
export const AuthoringSection: React.FC<ISectionProps> = ({
id,
can_collapse_small,
updateFunction,
layout: initLayout = defaultLayout,
- Read upRead up
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 MWInteractiveAuthoring
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const MWInteractiveAuthoring: React.FC<Props> = (props) => {
const {
interactive,
defaultClickToPlayPrompt,
authoringApiUrls,
File api.ts
has 387 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
IInitInteractive,
ISupportedFeaturesRequest,
INavigationOptions,
IAuthInfo,
Function InteractiveIframe
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const InteractiveIframe: React.FC<Props> = (props) => {
const {
src, width, initMsg, onAuthoredStateChange, onLinkedInteractivesChange, resetCount,
onSupportedFeaturesUpdate, authoredAspectRatio, authoredAspectRatioMethod,
authoringApiUrls
File project-settings-form.tsx
has 382 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as React from "react";
import { useEffect, useState } from "react";
import { SlateContainer, slateToHtml, htmlToSlate } from "@concord-consortium/slate-editor";
import { IProject, IProjectAdmin } from "../types";
import { camelToSnakeCaseKeys, snakeToCamelCaseKeys } from "../../shared/convert-keys";
Class Run
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
class Run < ActiveRecord::Base
# NOTE: additional status flags should use bitmask values (0x2, 0x4, etc) so that multiple flags can be set at the same time
SentToReportServiceStatusFlag = 0x1
Function SectionItemMoveDialog
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const SectionItemMoveDialog: React.FC = () => {
const { moveItem, getSections } = usePageAPI();
const { userInterface: {movingItemId}, actions: {setMovingItemId}} = React.useContext(UserInterfaceContext);
const [selectedColumn, setSelectedColumn] = useState(SectionColumns.PRIMARY);
const [selectedOtherItemId, setSelectedOtherItemId] = useState("");
Method initialize
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(user)
# Define abilities for the passed in user here.
#
# See the wiki for details:
# https://github.com/ryanb/cancan/wiki/Defining-Abilities
Function prep
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
publicMethod.prep = function (object) {
if (!open) {
return;
}
Function ModalApiPlugin
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ModalApiPlugin = (iframePhone: IFramePhoneStub) => {
const modalMap: Record<string, ModalState> = {};
function showAlert(options: IShowAlert) {
const { style, title: _title, text } = options;
Consider simplifying this complex logical expression. Open
elsif user.is_project_admin?
can :create, Glossary
can :duplicate, Glossary
can :export, Glossary
can :import, Glossary
Method duplicate
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def duplicate(helper=nil, new_page_id=nil)
helper = LaraDuplicationHelper.new if helper.nil?
new_section = Section.new(to_hash)
if new_page_id.nil?
new_section.position = new_section.position + 1
- Read upRead up
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 ModalApiPlugin
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
export const ModalApiPlugin = (iframePhone: IFramePhoneStub) => {
const modalMap: Record<string, ModalState> = {};
function showAlert(options: IShowAlert) {
const { style, title: _title, text } = options;
- Read upRead up
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
Class InteractivePage
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class InteractivePage < ActiveRecord::Base
attr_accessible :lightweight_activity, :name, :position, :layout, :sidebar, :show_header,
:show_sidebar, :show_interactive, :show_info_assessment, :toggle_info_assessment,
:embeddable_display_mode, :sidebar_title, :is_hidden, :additional_sections, :is_completion
File lightweight_activity.rb
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
class LightweightActivity < ActiveRecord::Base
include Publishable # defines methods to publish to portals
include PublicationStatus # defines publication status scopes and helpers
include FixedWidthLayout # defines fixed width options
include Accessible # defines font options
Function PageNavMenu
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
export const PageNavMenu: React.FC<IPageNavMenuProps> = ({
pages,
currentPageId,
copyingPage,
addPage,
- Read upRead up
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"