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', {
Severity: Minor
Found in server/controllers/register.js - About 25 mins to fix

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 });
Severity: Minor
Found in server/lib/passport.js - About 25 mins to fix

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.' };
Severity: Minor
Found in server/controllers/request.js - About 25 mins to fix

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');

Severity: Minor
Found in server/backends/irc/controller.js - About 25 mins to fix

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();

Severity: Minor
Found in new-client/src/components/Window.tsx - About 25 mins to fix

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

Severity
Category
Status
Source
Language