concord-consortium/lara

View on GitHub

Showing 830 of 830 total issues

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

        {pathToTinyMCE &&
          <Editor
            tinymceScriptSrc={pathToTinyMCE}
            onInit={initEditor}
            initialValue={content}
lara-typescript/src/section-authoring/components/page-sidebar/rich-editor.tsx on lines 40..67

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

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

      {pathToTinyMCE &&
        <Editor
          tinymceScriptSrc={pathToTinyMCE}
          onInit={initEditor}
          initialValue={content}
lara-typescript/src/section-authoring/components/text-block-edit-form.tsx on lines 91..118

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

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

export const HiddenIcon = (props: IHiddenIconProps) => {
  const height = props.height ? props.height : kDefaultHeight;
  const width = props.width ? props.width : kDefaultWidth;

  return(
Severity: Major
Found in lara-typescript/src/shared/components/icons/hidden-icon.tsx and 5 other locations - About 5 hrs to fix
lara-typescript/src/shared/components/icons/close-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/home-icon.tsx on lines 12..30
lara-typescript/src/shared/components/icons/move-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/next-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/previous-icon.tsx on lines 11..29

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

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

export const Next = (props: INextProps) => {
  const height = props.height ? props.height : kDefaultHeight;
  const width = props.width ? props.width : kDefaultWidth;

  return(
Severity: Major
Found in lara-typescript/src/shared/components/icons/next-icon.tsx and 5 other locations - About 5 hrs to fix
lara-typescript/src/shared/components/icons/close-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/hidden-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/home-icon.tsx on lines 12..30
lara-typescript/src/shared/components/icons/move-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/previous-icon.tsx on lines 11..29

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

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("can move an item backward from one page to another, not specifying item destination", () => {
      const pages = makePages(3);
      const destination: IItemDestination = {
        destPageId: "page1",
        relativeLocation: RelativeLocation.Before,
lara-typescript/src/section-authoring/util/move-utils.spec.ts on lines 197..208

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

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("can move an item backward from the first section to the last not specifying item destination", () => {
      const pages = makePages(3);
      const destination: IItemDestination = {
        destPageId: "page2",
        relativeLocation: RelativeLocation.Before,
lara-typescript/src/section-authoring/util/move-utils.spec.ts on lines 184..195

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

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

export const Previous = (props: IPreviousProps) => {
  const height = props.height ? props.height : kDefaultHeight;
  const width = props.width ? props.width : kDefaultWidth;

  return(
lara-typescript/src/shared/components/icons/close-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/hidden-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/home-icon.tsx on lines 12..30
lara-typescript/src/shared/components/icons/move-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/next-icon.tsx on lines 11..29

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

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

export const Move = (props: INextProps) => {
  const height = props.height ? props.height : kDefaultHeight;
  const width = props.width ? props.width : kDefaultWidth;

  return(
Severity: Major
Found in lara-typescript/src/shared/components/icons/move-icon.tsx and 5 other locations - About 5 hrs to fix
lara-typescript/src/shared/components/icons/close-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/hidden-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/home-icon.tsx on lines 12..30
lara-typescript/src/shared/components/icons/next-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/previous-icon.tsx on lines 11..29

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

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

export const Home = (props: IHomeProps) => {
  const height = props.height ? props.height : kDefaultHeight;
  const width = props.width ? props.width : kDefaultWidth;

  return(
Severity: Major
Found in lara-typescript/src/shared/components/icons/home-icon.tsx and 5 other locations - About 5 hrs to fix
lara-typescript/src/shared/components/icons/close-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/hidden-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/move-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/next-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/previous-icon.tsx on lines 11..29

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

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

export const Close = (props: ICloseProps) => {
  const height = props.height ? props.height : kDefaultHeight;
  const width = props.width ? props.width : kDefaultWidth;

  return(
Severity: Major
Found in lara-typescript/src/shared/components/icons/close-icon.tsx and 5 other locations - About 5 hrs to fix
lara-typescript/src/shared/components/icons/hidden-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/home-icon.tsx on lines 12..30
lara-typescript/src/shared/components/icons/move-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/next-icon.tsx on lines 11..29
lara-typescript/src/shared/components/icons/previous-icon.tsx on lines 11..29

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

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

export const MWInteractiveAuthoring: React.FC<Props> = (props) => {
  const {
    interactive,
    defaultClickToPlayPrompt,
    authoringApiUrls,
Severity: Major
Found in lara-typescript/src/page-item-authoring/mw-interactives/index.tsx - About 5 hrs to fix

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

    import {
      IInitInteractive,
      ISupportedFeaturesRequest,
      INavigationOptions,
      IAuthInfo,
    Severity: Minor
    Found in lara-typescript/src/interactive-api-client/api.ts - About 5 hrs to fix

      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";
        Severity: Minor
        Found in lara-typescript/src/projects/components/project-settings-form.tsx - About 5 hrs to fix

          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
          
          
          Severity: Minor
          Found in app/models/run.rb - About 5 hrs to fix

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

                {
                  id: 1,
                  serializeable_id: "LibraryInteractive_1",
                  name: "Carousel",
                  type: "LibraryInteractive",
            lara-typescript/src/section-authoring/api/mock-api-provider.ts on lines 447..475
            lara-typescript/src/section-authoring/api/mock-api-provider.ts on lines 476..504
            lara-typescript/src/section-authoring/api/mock-api-provider.ts on lines 505..533

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

            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

            export const MenuIcon = (props: IMenuIconProps) => {
              const height = props.height ? props.height : kDefaultHeight;
              const width = props.width ? props.width : kDefaultWidth;
            
              return (
            Severity: Major
            Found in lara-typescript/src/shared/components/icons/menu-icon.tsx and 1 other location - About 5 hrs to fix
            lara-typescript/src/shared/components/icons/menu-close-icon.tsx on lines 11..28

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

            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

            export const MenuCloseIcon = (props: IMenuCloseIconProps) => {
              const height = props.height ? props.height : kDefaultHeight;
              const width = props.width ? props.width : kDefaultWidth;
            
              return (
            lara-typescript/src/shared/components/icons/menu-icon.tsx on lines 11..28

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

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

                {
                  id: 3,
                  serializeable_id: "LibraryInteractive_3",
                  name: "Drag & Drop",
                  type: "LibraryInteractive",
            lara-typescript/src/section-authoring/api/mock-api-provider.ts on lines 418..446
            lara-typescript/src/section-authoring/api/mock-api-provider.ts on lines 476..504
            lara-typescript/src/section-authoring/api/mock-api-provider.ts on lines 505..533

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

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

                {
                  id: 4,
                  serializeable_id: "LibraryInteractive_4",
                  name: "Fill in the Blank",
                  type: "LibraryInteractive",
            lara-typescript/src/section-authoring/api/mock-api-provider.ts on lines 418..446
            lara-typescript/src/section-authoring/api/mock-api-provider.ts on lines 447..475
            lara-typescript/src/section-authoring/api/mock-api-provider.ts on lines 505..533

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

            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