Showing 250 of 735 total issues
Function ClassConference
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ClassConference() {
const classes = useStyles();
const showChat = useSelector(selectShowChat);
Class SceneTalkingStickTests
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
public class SceneTalkingStickTests : ServiceIntegrationTest
{
private const string ConferenceId = TestData.ConferenceId;
private const string DefaultRoomId = RoomOptions.DEFAULT_ROOM_ID;
Function updateCanvas
has a Cognitive Complexity of 16 (exceeds 5 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) {
- 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 createSendTransport
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async createSendTransport(): Promise<Transport> {
const transportOptions = await this.client.createTransport({
sctpCapabilities: this.device.sctpCapabilities,
producing: true,
consuming: false,
Method Login
has 52 lines of code (exceeds 25 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
Method CreatePatch
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void CreatePatch(JToken original, JToken modified, JsonPatchPath path, IPatchContext context)
{
var originalArr = (JArray) original;
var modifiedArr = (JArray) modified;
Function AudioSettings
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function AudioSettings() {
const classes = useStyles();
const { t } = useTranslation();
const audioGain = useSelector((state: RootState) => state.settings.obj.mic.audioGain);
const audioDevice = useSelector((state: RootState) => state.settings.obj.mic.device);
Function useConsumer
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function useConsumer(
participantId: string | undefined,
kind: ProducerSource,
): Consumer | null | undefined {
const [consumer, setConsumer] = useState<Consumer | null | undefined>(undefined);
Function About
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function About() {
const { t } = useTranslation();
const classes = useStyles();
return (
Function AudioSettingsTest
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function AudioSettingsTest() {
const classes = useStyles();
const { t } = useTranslation();
const myId = useMyParticipantId();
Function onMouseDown
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
onMouseDown(event: IEvent): void {
if (event.target) return;
const canvas = this.getCanvas();
if (canvas.getActiveObject()) return;
Function Settings
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Settings() {
const classes = useStyles();
const [value, setValue] = React.useState(0);
const { t } = useTranslation();
Method OpenBreakoutRooms_MoveToBreakoutRoom_UpdatePermissions
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Fact]
public async Task OpenBreakoutRooms_MoveToBreakoutRoom_UpdatePermissions()
{
const int amount = 1;
Function generateGrid
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function generateGrid(
itemsCount: number,
itemMaxWidth: number,
boundingBox: Size,
spacing: number,
Function main
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function main() {
const lightship = createLightship({ detectKubernetes: false });
const rabbitConn = new RabbitMqConn(config.services.rabbitMq);
Function initialize
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async initialize(): Promise<void> {
const signalr = appHubConn.current;
if (!signalr) {
throw new Error('SignalR connection is not available.');
}
Method Handle
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task<Unit> Handle(SubmitAnswerRequest request, CancellationToken cancellationToken)
{
var (participant, pollId, answer) = request;
var poll = await _repository.GetPoll(participant.ConferenceId, pollId);
Function AudioRecorderTest
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export default function AudioRecorderTest({ stream, className }: Props) {
if (!window.MediaRecorder) {
return null;
}
- 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 SceneManagement
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export default function SceneManagement() {
const dispatch = useDispatch();
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 changeStream
has a Cognitive Complexity of 13 (exceeds 5 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) };
}
- 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"