src/electron/main/helpers.js

Summary

Maintainability
C
1 day
Test Coverage

Function buildMenu has 103 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function buildMenu(mainWindow) {
  const template = [];
  const name = app.getName();

  template.unshift(
Severity: Major
Found in src/electron/main/helpers.js - About 4 hrs to fix

    File helpers.js has 287 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint no-console: 0 */
    const { shell, app, Menu, ipcMain } = require('electron');
    const { autoUpdater } = require('electron-updater');
    const log = require('electron-log');
    const { init } = require('@sentry/electron');
    Severity: Minor
    Found in src/electron/main/helpers.js - About 2 hrs to fix

      Function handleMacOSUpdates has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function handleMacOSUpdates(mainWindow) {
        if (isMacOS) {
          const LATEST_RELEASED_VERSION_URL = 'https://api.github.com/repos/Gisto/Gisto/releases/latest';
          const request = require('superagent');
          const semver = require('semver');
      Severity: Minor
      Found in src/electron/main/helpers.js - About 1 hr to fix

        Function updateChecker has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function updateChecker(mainWindow) {
          ipcMain.on('downloadUpdate', () => autoUpdater.downloadUpdate());
          ipcMain.on('quitAndInstall', () => autoUpdater.quitAndInstall(true, true));
        
          autoUpdater.logger = log;
        Severity: Minor
        Found in src/electron/main/helpers.js - About 1 hr to fix

          Function handleDownload has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function handleDownload(win) {
            win.webContents.session.on('will-download', (event, item, sender) => {
              const isUpdateUrl = includes(
                ['https://github.com/Gisto/Gisto/releases/download/'],
                head(item.getURLChain())
          Severity: Minor
          Found in src/electron/main/helpers.js - About 1 hr to fix

            There are no issues that match your filters.

            Category
            Status