Showing 165 of 254 total issues
Function createExt
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports.createExt = async function createExt(ctx) {
const form = await decodeForm(ctx.req, registrationFormExt);
async function renderForm() {
await ctx.render('register-ext', {
- 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 authExt
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function authExt(openidId, oauthId, profile, done) {
let user = null;
if (oauthId) {
user = await User.findFirst({ extAuthId: oauthId });
- 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 start1on1
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function start1on1(user, targetUserGId, network) {
let selectedNetwork = network;
if (!targetUserGId || !targetUserGId.valid) {
return { status: 'ERROR', errorMsg: 'Malformed 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 processDisconnected
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function processDisconnected({ userId, network, reason }) {
const user = await User.fetch(userId);
const networkInfo = await findOrCreateNetworkInfo(user, network);
const previousState = networkInfo.get('state');
- 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 Window
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Window: FunctionComponent<WindowProps> = ({ window, height = 100, singleWindowMode }: WindowProps) => {
const { windowStore } = useContext(ServerContext);
const [isMoving, setIsMoving] = useState<boolean>(false);
const navigate = useNavigate();
- 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"