Showing 274 of 1,062 total issues
File types.ts
has 831 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Props as ConceptWidgetProps } from './common/ConceptWidget'
import { Props as ExerciseWidgetProps } from './common/ExerciseWidget'
import { Flair } from './common/HandleWithFlair'
import { DiscussionPostProps } from './mentoring/discussion/DiscussionPost'
import { Scratchpad } from './mentoring/Session'
File application.tsx
has 759 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable @typescript-eslint/no-explicit-any */
import React, { lazy, Suspense } from 'react'
import { camelizeKeys } from 'humps'
import { camelizeKeysAs } from '@/utils/camelize-keys-as'
import { initReact } from '@/utils/react-bootloader'
Function loadLanguageCompartment
has 252 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const loadLanguageCompartment = async (
language: string
): Promise<Extension> => {
switch (language) {
case 'cpp': {
File internal.tsx
has 578 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable @typescript-eslint/no-explicit-any */
// Absolute, module imports
import React, { Suspense, lazy } from 'react'
import { camelizeKeys } from 'humps'
import currency from 'currency.js'
mappings
has 66 functions (exceeds 20 allowed). Consider refactoring. Open
export const mappings = {
'share-link': (data: any): JSX.Element => (
<Suspense fallback={RenderLoader()}>
<ShareLink
title={data.title}
Function Session
has 208 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Session(props: SessionProps): JSX.Element {
const [session, setSession] = useState(props)
const {
student,
track,
`` has 47 functions (exceeds 20 allowed). Consider refactoring. Open
initReact({
'common-markdown-editor': (data: any) => (
<Suspense fallback={RenderLoader()}>
<MarkdownEditor contextId={data.context_id} />
</Suspense>
File tailwind.config.js
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
module.exports = {
mode: 'jit',
options: {
// The following extractor is the same as the default of v2, except it includes cut off points for semicolons.
defaultExtractor: (line) => {
Function useDropdown
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useDropdown = (
itemLength: number,
onItemSelect?: (index: number) => void,
panelOptions?: any
): DropdownAttributes => {
Function exports
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (api) {
var validEnv = ['development', 'test', 'production']
var currentEnv = api.env()
var isDevelopmentEnv = api.env('development')
var isProductionEnv = api.env('production')
Function Info
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
export const Info = ({
exercise,
track,
solution,
renderBlurb,
- 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 createChartConfig
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createChartConfig(
data: number[],
labels: string[],
milestones: Milestone[],
dateMap: { [key: string]: number }
Method impact
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
def impact
# This is the calculation for the average first iteration time.
# It comes out at 2594 (seconds) at the time of writing
#
# SELECT AVG(dd.val) as median_val
Method git_filepath
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def git_filepath(field, file:, append_file: nil)
if file.instance_of?(Proc)
read_method = "read_text_blob"
else
json_file = file.end_with?('.json')
- 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 NotificationsMailer
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class NotificationsMailer < ApplicationMailer
def mentor_started_discussion
notification = params[:notification]
@user = notification.user
@discussion = notification.discussion
File Session.tsx
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
useState,
createContext,
useCallback,
useEffect,
Function Header
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export const Header = ({
iteration,
exercise,
links,
}: {
- 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 useSubmissionsList
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useSubmissionsList = (
defaultList: readonly Submission[],
links: Links
): {
current: Submission | null
Function smoothDataPoints
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const smoothDataPoints = (
dataPoints: DataPoint[],
height: number
): DataPoint[] => {
return dataPoints.reduce(
Function drawCustomTooltip
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawCustomTooltip(
ctx: CanvasRenderingContext2D,
options: CustomTooltipOptions
) {
const {