Showing 1,205 of 1,252 total issues
Function LanguageFields
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const LanguageFields = (props: LanguageFieldsProps): JSX.Element => {
const { t } = useTranslation();
const { control, watch, setValue } = useFormContext<ProgrammingFormData>();
- Create a ticketCreate a ticket
Function LogsContent
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const LogsContent: FC<Props> = (props) => {
const { with: data } = props;
const { t } = useTranslation();
if (data && data.length === 0) {
- Create a ticketCreate a ticket
Function SkillManagementButtons
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SkillManagementButtons: FC<Props> = (props) => {
const {
id,
canUpdate,
canDestroy,
- Create a ticketCreate a ticket
Function CourseSettings
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CourseSettings = (): JSX.Element => {
const reloadItems = useItemsReloader();
const { t } = useTranslation();
const [form, setForm] = useState<FormEmitter<CourseInfo>>();
const [reloadForm, setReloadForm] = useState(false);
- Create a ticketCreate a ticket
Function DataFilesManager
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DataFilesManager = (props: DataFilesManagerProps): JSX.Element => {
const { t } = useTranslation();
const { control } = useFormContext<ProgrammingFormData>();
- Create a ticketCreate a ticket
Class Assessment
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Course::Assessment < ApplicationRecord
acts_as_lesson_plan_item has_todo: true
acts_as_conditional
has_one_folder
- Create a ticketCreate a ticket
Function SurveyConditionForm
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SurveyConditionForm = (
props: AnyConditionProps<SurveyConditionData> & { surveys: AvailableSurveys },
): JSX.Element => {
const { ids, surveys } = props.surveys;
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function renderStatus
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const renderStatus = (): JSX.Element | null => {
switch (status) {
case CommentStatusTypes.loading:
return (
<div
- Create a ticketCreate a ticket
Function AchievementAward
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AchievementAward: FC<Props> = (props) => {
const { achievementId, open, handleClose, intl } = props;
const [discardDialogOpen, setDiscardDialogOpen] = useState(false);
const [isDirty, setIsDirty] = useState(false);
- Create a ticketCreate a ticket
Function onSubmit
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const onSubmit = (formData: SkillFormData, setError): Promise<void> => {
switch (dialogType) {
case DialogTypes.NewSkill:
return dispatch(createSkill(formData))
.then((response) => {
- Create a ticketCreate a ticket
Function formatAnswerSpecific
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const formatAnswerSpecific = (answer) => {
const answerMap = {
[questionTypes.MultipleChoice]: () => ({
option_ids: answer.option_ids,
}),
- Create a ticketCreate a ticket
Function importProgrammingFiles
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function importProgrammingFiles(answerId, files, language, resetField) {
const filesPayload = files.map((file) => ({
id: file.id,
filename: file.filename,
content: file.content,
- Create a ticketCreate a ticket
Function AchievementsIndex
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AchievementsIndex: FC = () => {
const { t } = useTranslation();
const [isLoading, setIsLoading] = useState(true);
const [isOpen, setIsOpen] = useState(false);
const [isReordering, setIsReordering] = useState(false);
- Create a ticketCreate a ticket
Function NotificationCard
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const NotificationCard: FC<Props> = (props) => {
const { intl, notification } = props;
let actableLink = '';
let concatMessage = '';
- Create a ticketCreate a ticket
Function CoursesIndex
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CoursesIndex: FC = () => {
const { t } = useTranslation();
const [params] = useSearchParams();
- Create a ticketCreate a ticket
Function LiveFeedbackDetails
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const LiveFeedbackDetails: FC<Props> = (props) => {
const { t } = useTranslation();
const { file } = props;
const startingLineNum = Math.min(
- Create a ticketCreate a ticket
Function AssessmentSessionNew
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AssessmentSessionNew = (): JSX.Element => {
const [submitting, setSubmitting] = useState(false);
const { t } = useTranslation();
const navigate = useNavigate();
const [params] = useSearchParams();
- Create a ticketCreate a ticket
Function WarningDialog
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const WarningDialog: FC = () => {
const { t } = useTranslation();
const assessment = useAppSelector(getAssessment);
const submission = useAppSelector(getSubmission);
- Create a ticketCreate a ticket
Function Dashboard
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
const Dashboard = (props) => {
const { dispatch, intl, isLoading, nodes, response, selectedElement } = props;
const [deleteArrowConfirmation, setDeleteArrowConfirmation] = useState(false);
const isEmptyResponse =
- Read upRead up
- Create a ticketCreate a ticket
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 renderDownloadDropdown
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
renderDownloadDropdown() {
const {
assessment,
handleDownload,
handleDownloadStatistics,
- Read upRead up
- Create a ticketCreate a ticket
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"