Showing 1,205 of 1,252 total issues
Function SidebarItem
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SidebarItem = (props: SidebarItemProps): JSX.Element => {
const { of: item, square, exact, activePath } = props;
const location = useLocation();
const activeUrl = activePath ?? location.pathname + location.search;
- Create a ticketCreate a ticket
Function ActivityCenter
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ActivityCenter = (props: ActivityCenterProps): JSX.Element => {
const { t } = useTranslation();
const history = useAppSelector(select('history'));
const monitoring = useMonitoring();
- Create a ticketCreate a ticket
Function TestCaseRow
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TestCaseRow: FC<Props> = (props) => {
const { result } = props;
const nameRegex = /\/?(\w+)$/;
const idMatch = result.identifier?.match(nameRegex);
- Create a ticketCreate a ticket
Function InstancesButtons
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InstancesButtons: FC<Props> = (props) => {
const { intl, instance } = props;
const dispatch = useAppDispatch();
const [isDeleting, setIsDeleting] = useState(false);
- Create a ticketCreate a ticket
Function ForbiddenPage
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ForbiddenPage = (): JSX.Element => {
const { t } = useTranslation();
const sourceURL = useLoaderData() as string | null;
- Create a ticketCreate a ticket
Function videoSessionReducer
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function videoSessionReducer(state = initialState, action) {
if (!state.sessionId) {
return state;
}
const events = state.sessionEvents;
- Create a ticketCreate a ticket
Function render
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { dispatch, columnsVisible } = this.props;
return (
<>
- Create a ticketCreate a ticket
Function default
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (state = initialState, action) {
switch (action.type) {
case actionTypes.RECORDER_SET_RECORDING: {
const { recordingComponentId } = action.payload || {};
return {
- Create a ticketCreate a ticket
Function render
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
dispatch,
open,
destinationCourseId,
- Create a ticketCreate a ticket
Function renderLessonPlanItemSettingsForComponentsTable
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderLessonPlanItemSettingsForComponentsTable() {
const { lessonPlanItemSettings } = this.props;
const componentItemSettings = lessonPlanItemSettings.filter((setting) =>
['course_videos_component', 'course_survey_component'].includes(
setting.component,
- Create a ticketCreate a ticket
Function renderBody
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderBody() {
const {
isLoading,
isCourseSelected,
duplicationMode,
- Create a ticketCreate a ticket
Function DrawPopover
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DrawPopover = (props) => {
const {
intl,
open,
anchorEl,
- Create a ticketCreate a ticket
Function AnnouncementEdit
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AnnouncementEdit: FC<Props> = (props) => {
const {
open,
onClose,
announcementId,
- Create a ticketCreate a ticket
Function MoveAssessmentsMenu
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const MoveAssessmentsMenu = (
props: MoveAssessmentsMenuProps,
): JSX.Element | null => {
const { t } = useTranslation();
const { tabs, onSelectTab } = props;
- Create a ticketCreate a ticket
Function UserMenuButton
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UserMenuButton = (): JSX.Element | null => {
const { user } = useAppContext();
const auth = useAuthAdapter();
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function AchievementReordering
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AchievementReordering = (
props: AchievementReorderingProps,
): JSX.Element => {
const { handleReordering, isReordering } = props;
- Create a ticketCreate a ticket
Function TestCasesTable
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TestCasesTable = (
props: TestCasesTableProps & { children: ReactNode },
): JSX.Element => {
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function UnavailableMessage
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UnavailableMessage = (
props: UnavailableMessageProps,
): JSX.Element | null => {
const { for: assessment } = props;
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function render
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
render() {
const {
intl,
open,
onCancel,
- 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
Method topic_created
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def topic_created(user, course_user, topic)
course = topic.forum.course
email_enabled = course.email_enabled(:forums, :new_topic)
return unless email_enabled.regular || email_enabled.phantom
- 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"