Showing 250 of 735 total issues
Function useWebRtcConnectionHealth
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useWebRtcConnectionHealth(): SfuConnectionHealth | undefined {
const connection = useWebRtc();
const [health, setHealth] = useState<SfuConnectionHealth | undefined>();
useEffect(() => {
Method Aggregate_CaseInsensitive_BuildCloud
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Fact]
public async Task Aggregate_CaseInsensitive_BuildCloud()
{
// arrange
var aggregator = new TagCloudAggregator();
Function synchronizeObjectState
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function synchronizeObjectState<TS = any>(
requests: SynchronizeProperty | SynchronizeProperty[],
syncObjDeletedCallback?: (state: TS, syncObjId: string) => void,
) {
if (!Array.isArray(requests)) {
Function selectAvailableInputDevicesFactory
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const selectAvailableInputDevicesFactory = () =>
createSelector(selectLocalDevices, selectEquipmentConnections, getSource, (devices, equipment, source) => {
const result = new Array<DeviceGroup>();
if (devices) {
- 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 DeviceSelector
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function DeviceSelector({ devices, defaultName, className, selectedDevice, onChange, label }: Props) {
const selectId = defaultName.toLowerCase() + '-select';
const classes = useStyles();
const dispatch = useDispatch();
const { t } = useTranslation();
- 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 ParticipantContextMenuTempPermissions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function ParticipantContextMenuTempPermissions({ participantId }: Props) {
const { t } = useTranslation();
const tempPermissions = useSelector((state: RootState) => selectParticipantTempPermissions(state, participantId));
const dispatch = useDispatch();
const classes = useStyles();
- 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 registerValidSW
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function registerValidSW(swUrl: string, config?: Config) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
Function handleKeyPress
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleKeyPress = (key: string, ctrl: boolean, shift: boolean) => {
if (readOnly) return;
if (key === 'z' && ctrl && !shift) {
if (canUndo) onUndo();
Function createReceiveTransport
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async createReceiveTransport(): Promise<Transport> {
this.pendingConsumers = [];
const transportOptions = await this.client.createTransport({ producing: false, consuming: true });
Function wrapControl
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wrapControl(
source: ProducerSource,
device: AnyInputDevice | undefined,
local: UseMediaState,
equipment: Record<string, EquipmentConnection> | undefined,
Method ApplyScene
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async Task ApplyScene(string conferenceId, string roomId, ActiveScene scene, SceneState currentState)
{
var sceneState = await CreateNewSceneState(conferenceId, roomId, scene, currentState);
await _sceneRepository.SetSceneState(conferenceId, roomId, sceneState);
Method HandleInternal
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async Task<SuccessOrError<Unit>> HandleInternal(PatchConferenceRequest request,
CancellationToken cancellationToken)
{
var (conferenceId, patch) = request;
Method TalkingStick_Moderated_Return_RemovePresenter
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Fact]
public async Task TalkingStick_Moderated_Return_RemovePresenter()
{
// arrange
var (conn, conference) = await ConnectToOpenedConference();
Function executeCommand
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const executeCommand = async () => {
try {
switch (command.action) {
case 'enable':
await control.enable();
Function mapStats
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mapStats = (report: RTCStatsReport): StatsRow[] => {
const stats = Array.from(report);
return [
...stats
.filter(([, value]) => value.type === 'transport')
Function RoomsList
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function RoomsList() {
const classes = useStyles();
const rooms = useSelector(selectRoomViewModels);
const participants = useSelector(selectParticipants);
Function App
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function App() {
return (
<MuiPickersUtilsProvider utils={LuxonUtils}>
<ThemeProvider theme={theme}>
<MaterialUiToaster />
Method CloseConference_PollsOpen_DeleteAllPolls
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Fact]
public async Task CloseConference_PollsOpen_DeleteAllPolls()
{
// arrange
var (connection, _) = await ConnectToOpenedConference();
Method EnforceGlobalLimit
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void EnforceGlobalLimit(Dictionary<string, ParticipantWhiteboardState> states)
{
var totalHistory = states.Sum(x => x.Value.RedoList.Count + x.Value.UndoList.Count);
if (totalHistory > _options.MaxUndoHistory)
{
Function CommandHistory
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function CommandHistory() {
const { t } = useTranslation();
const history = useSelector((state: RootState) => state.equipment.commandHistory);
const devices = useSelector(selectLocalDevices);