Showing 250 of 735 total issues
Function fixPathInstructions
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function fixPathInstructions(segments: string[]): (string | number)[][] {
if (segments.length === 0) return [];
const result = new Array<(string | number)[]>();
let currentChunk = new Array<string | number>();
- 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
Method Login
has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring. Open
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Login(LoginInputModel model, string button)
{
// check if we are in the context of an authorization request
- 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 WebcamSettingsTest
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function WebcamSettingsTest() {
const classes = useStyles();
const myId = useMyParticipantId();
const { t } = useTranslation();
const consumer = useConsumer(myId, 'loopback-webcam');
Method Reschedule
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async void Reschedule()
{
while (true)
{
ParticipantInChannel nextParticipant;
Function getStatusMessage
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const getStatusMessage: (health: WebRtcHealth, t: TFunction<'translation'>) => string = (health, t) => {
if (health.connection?.status === 'ok' && health.connector.status === 'ok')
return t(`${webRtcNamespace}.connected.message`);
if (health.connector.status !== 'ok') {
- 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 EquipmentSettings
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default function EquipmentSettings() {
const dispatch = useDispatch();
const { t } = useTranslation();
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 CreateConferenceDialog
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function CreateConferenceDialog() {
const dispatch = useDispatch();
const theme = useTheme();
const classes = useStyles();
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 MultipleChoiceAnswerForm
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default function MultipleChoiceAnswerForm({
onSubmit,
onDelete,
poll: { poll, answer },
footerPortalRef,
- 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 updateParticipant
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
async updateParticipant(participant: Participant): Promise<void> {
const status = this.participantStatus.get(participant.participantId);
if (status) {
logger.info('updateParticipant() | participantId: %s | roomId: %s', participant.participantId, this.id);
Function updateActiveParticipants
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function* updateActiveParticipants(): any {
const participantAudio: { [id: string]: ParticipantAudioInfo | undefined } = yield select(selectParticipantAudio);
let activeParticipants: ActiveParticipants = yield select(selectActiveParticipants);
// remove participants that left the conference
Function PassStickFab
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function PassStickFab() {
const { t } = useTranslation();
const dispatch = useDispatch();
const classes = useStyles();
Function createTransport
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async createTransport(
{ sctpCapabilities, forceTcp, producing, consuming }: CreateTransportRequest,
connectionId: string,
): Promise<SuccessOrError<CreateTransportResponse>> {
const connection = this.connections.get(connectionId);
Method WaitForEventInternal
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async Task WaitForEventInternal(Func<bool> testCondition, TimeSpan timeout)
{
var timeoutTimestamp = DateTimeOffset.UtcNow.Add(timeout);
var autoResetEvent = new AsyncAutoResetEvent(false);
Method RemoveParticipant
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async Task RemoveParticipant(Participant participant, string? connectionId,
CancellationToken cancellationToken)
{
_logger.LogDebug("RemoveParticipant() | {participant}, connectionId:{connectionId}", participant,
connectionId);
Function ChatBar
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ChatBar() {
const classes = useStyles();
const participants = useSelector(selectParticipantList);
const connected = useSelector((state: RootState) => state.signalr.isConnected);
const channels = useSelector(selectChannels);
Function getChannel
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async getChannel(): Promise<RabbitChannel> {
if (this.cachedChannel) return this.cachedChannel;
try {
this.cachedChannel = await retry(
Function changeStream
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async changeStream({ id, type, action }: ChangeStreamRequest, connectionId: string): Promise<SuccessOrError> {
const connection = this.connections.get(connectionId);
if (!connection) {
return { success: false, error: errors.connectionNotFound(connectionId) };
}
Function MainRoute
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function MainRoute() {
const classes = useStyles();
const dispatch = useDispatch();
const { t } = useTranslation();
Function MultipleChoiceInstructionForm
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function MultipleChoiceInstructionForm(props: InstructionFormProps) {
const { t } = useTranslation();
const {
form: {
register,
Function updateParticipant
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async updateParticipant(participant: Participant): Promise<void> {
await this.lock.acquire(participant.participantId, async () => {
// loopback is independent from the room
await this.loopbackManager.updateParticipant(participant);