Showing 1,205 of 1,252 total issues
Function ForumPostResponse
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ForumPostResponse = (props) => {
const [errorMessage, setErrorMessage] = useState('');
const { question, readOnly, answerId, saveAnswerAndUpdateClientVersion } =
props;
const { control } = useFormContext();
- Create a ticketCreate a ticket
Function buildGenerateRequestPayload
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const buildGenerateRequestPayload = (
codaveriData: CodaveriGenerateFormData,
questionData: QuestionPrototypeFormData,
): FormData => {
const data = new FormData();
- Create a ticketCreate a ticket
Function ForumForm
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ForumForm: FC<Props> = (props) => {
const { open, editing, title, onClose, initialValues, onSubmit } = props;
const { t } = useTranslation();
return (
- Create a ticketCreate a ticket
Function DeleteTimelinePrompt
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DeleteTimelinePrompt = (
props: DeleteTimelinePromptProps,
): JSX.Element => {
const { deletes: timeline } = props;
- Create a ticketCreate a ticket
Function ForumTopicPostEditActionButtons
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ForumTopicPostEditActionButtons: FC<Props> = (props) => {
const { post, editValue, setIsEditing } = props;
const [discardEditPrompt, setDiscardEditPrompt] = useState(false);
const dispatch = useAppDispatch();
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function NodeToGateArrows
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const NodeToGateArrows = (props) => {
const {
arrowAnchorPositions,
arrowProperties,
canModify,
- Create a ticketCreate a ticket
Function renderSubmissionTable
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderSubmissionTable() {
const {
submission: {
workflowState,
bonusEndAt,
- Create a ticketCreate a ticket
Function shouldComponentUpdate
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
shouldComponentUpdate(nextProps) {
if (this.canvas) {
this.canvas.isDrawingMode = nextProps.scribing.isDrawingMode;
this.canvas.freeDrawingBrush.color =
nextProps.scribing.colors[scribingToolColor.DRAW];
- Create a ticketCreate a ticket
Function render
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
submissionState,
showPrivate,
showEvaluation,
- Create a ticketCreate a ticket
Function VideosSettings
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const VideosSettings = (): JSX.Element => {
const reloadItems = useItemsReloader();
const { t } = useTranslation();
const [form, setForm] = useState<FormEmitter<VideosSettingsData>>();
const [submitting, setSubmitting] = useState(false);
- Create a ticketCreate a ticket
Function SubmissionTimeAndGradeChart
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SubmissionTimeAndGradeChart: FC<Props> = (props) => {
const { t } = useTranslation();
const { submissions } = props;
const { labels, lineData, barData } = processSubmissionsIntoChartData(
submissions.map(processSubmission),
- Create a ticketCreate a ticket
Function CoursesIndex
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CoursesIndex: FC<Props> = (props) => {
const { intl } = props;
const [isLoading, setIsLoading] = useState(false);
const [filter, setFilter] = useState({ active: false });
const courseCounts = useAppSelector(getAdminCounts);
- Create a ticketCreate a ticket
Function TopicCard
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
const TopicCard: FC<TopicCardProps> = (props) => {
const { topic } = props;
const { t } = useTranslation();
const dispatch = useAppDispatch();
- 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 render
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
src,
alt,
file,
- Create a ticketCreate a ticket
Function Node
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Node = (props) => {
const { canModify, getNodeConnectionPointId, node } = props;
const [isNodeMenuDisplayed, setIsNodeMenuDisplayed] = useState(false);
const zIndex = isNodeMenuDisplayed ? 999 : node.depth + 2;
- Create a ticketCreate a ticket
Function SessionDetailsPopup
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SessionDetailsPopup = (props: SessionDetailsPopupProps): JSX.Element => {
const {
anchorsOn: anchorElement,
for: name,
showing: heartbeats,
- Create a ticketCreate a ticket
Function AddEmailSubsection
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AddEmailSubsection = (props: AddEmailSubsectionProps): JSX.Element => {
const { t } = useTranslation();
const [email, setEmail] = useState('');
const [error, setError] = useState('');
const [expanded, setExpanded] = useState(false);
- Create a ticketCreate a ticket
Function SectionForm
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SectionForm = (props) => {
const { onSubmit, disabled, initialValues } = props;
const {
control,
handleSubmit,
- Create a ticketCreate a ticket
Function onload
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.image.onload = () => {
// Get the calculated width of canvas, 800 is min width for scribing toolbar
const element = document.getElementById(`canvas-${answerId}`);
const maxWidth = Math.max(element.getBoundingClientRect().width, 800);
- Create a ticketCreate a ticket
Function AssessmentList
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AssessmentList: FC<Props> = (props) => {
const { courseTitle } = props;
const assessmentCategories = useAppSelector((state) =>
getAllAssessmentCategories(state),
);
- Create a ticketCreate a ticket