Showing 250 of 735 total issues
Method ConfigureServices
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.AddLogging();
// Authentication
WhiteboardController
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
export default class WhiteboardController {
private fc: fabric.Canvas;
private tool: WhiteboardTool;
private options: WhiteboardToolOptions;
private unsubscribeTool: (() => void) | undefined;
Function createConsumer
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async createConsumer(connection: Connection, { producer, participantId }: ProducerInfo): Promise<void> {
logger.debug(
'createConsumer() from %s to %s (producer id: %s)',
participantId,
connection.participantId,
File conference.ts
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
import _ from 'lodash';
import { Router } from 'mediasoup/lib/Router';
import { Consumer, MediaKind, Producer, RtpCapabilities, WebRtcTransportOptions } from 'mediasoup/lib/types';
import { SuccessOrError } from '../../common-types';
import * as errors from '../../errors';
Function BreakoutRoomsPopper
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function BreakoutRoomsPopper(props: ListItemPopperProps) {
const dispatch = useDispatch();
const { t } = useTranslation();
const classes = useStyles();
Function EquipmentSettings
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function EquipmentSettings() {
const dispatch = useDispatch();
const { t } = useTranslation();
const classes = useStyles();
File WebRtcConnection.ts
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { HubConnection } from '@microsoft/signalr';
import debug from 'debug';
import { Device } from 'mediasoup-client';
import { MediaKind, RtpParameters, Transport } from 'mediasoup-client/lib/types';
import { HubSubscription, subscribeEvent, unsubscribeAll } from 'src/utils/signalr-utils';
File InMemoryDatabaseActions.cs
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading.Tasks;
Class InMemoryDatabaseTransaction
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
public class InMemoryDatabaseTransaction : InMemoryDatabaseActions, IKeyValueDatabaseTransaction
{
private readonly InMemoryKeyValueData _data;
private readonly List<Func<ValueTask>> _transactionSteps = new();
private readonly CancellationTokenSource _cancellationTokenSource = new();
Class InMemoryDatabaseActions
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
public abstract class InMemoryDatabaseActions : IKeyValueDatabaseActions
{
private readonly Dictionary<string, object> _data;
protected InMemoryDatabaseActions(Dictionary<string, object> data)
File SceneTalkingStickTests.cs
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Autofac;
using Microsoft.Extensions.Options;
Class SynchronizationTests
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
public class SynchronizationTests : ServiceIntegrationTest
{
private const string SyncObjId = "hello";
private const string ConferenceId = "45";
private const string ConnectionId = "connectionId";
Function BreakoutRoomsAssignments
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export default function BreakoutRoomsAssignments({ data, participants, createdRooms, onChange }: Props) {
const unassignedParticipants = participants.filter((x) => !data.find((y) => y.includes(x.id)));
const myParticipantId = useMyParticipantId();
useEffect(() => {
- 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 mergeDeep
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export function mergeDeep(target: any, source: any): any {
if (isObject(target) && isObject(source)) {
for (const key in source) {
if (isObject(source[key])) {
if (!target[key]) {
- 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 synchronizeObjectState
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export function synchronizeObjectState<TS = any>(
requests: SynchronizeProperty | SynchronizeProperty[],
syncObjDeletedCallback?: (state: TS, syncObjId: string) => void,
) {
if (!Array.isArray(requests)) {
- 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 CreateConferenceDialog
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function CreateConferenceDialog() {
const dispatch = useDispatch();
const theme = useTheme();
const classes = useStyles();
const { t } = useTranslation();
Function SceneView
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function SceneView() {
const classes = useStyles();
const [contentRef, dimensions] = useThrottledResizeObserver(100);
const sceneStack = useSelector(selectSceneStack);
Function updateCanvas
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public updateCanvas(canvas: WhiteboardCanvas) {
canvas = this.pathCache.preprocess(canvas); // paths must be unpacked from point array to svg paths
const newVersion = _.maxBy(canvas.objects, (x) => x.version)?.version ?? 0;
if (!this.currentVersion) {
Function useDeviceManagement
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function useDeviceManagement(
source: ProducerSource,
local: UseMediaState,
device?: AnyInputDevice,
): UseMediaState {
File OpenPollDialogForm.tsx
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
Box,
Button,
Checkbox,
Chip,