BerniWittmann/spielplanismaning

View on GitHub
src/public/templates/event/spielplan/spielplan.ui.js

Summary

Maintainability
C
1 day
Test Coverage

Function SpielplanController has 177 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function SpielplanController($state, $scope, spiele, spiel, auth, toastr, anzahlPlaetze, spielModus, zeiten, spielplanEnabled) {
        const vm = this;
        vm.loading = true;

        _.extend(vm, {
Severity: Major
Found in src/public/templates/event/spielplan/spielplan.ui.js - About 7 hrs to fix

    Function SpielplanController has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        function SpielplanController($state, $scope, spiele, spiel, auth, toastr, anzahlPlaetze, spielModus, zeiten, spielplanEnabled) {
    Severity: Major
    Found in src/public/templates/event/spielplan/spielplan.ui.js - About 1 hr to fix

      Function calcZeit has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function calcZeit(index) {
                  const plaetze = anzahlPlaetze;
                  const dailyStartTime = moment(zeiten.startzeit, 'HH:mm');
                  const dailyEndTime = moment(zeiten.endzeit, 'HH:mm');
                  const spielePerDay = Math.floor(dailyEndTime.diff(dailyStartTime, 'minutes') / (zeiten.spielzeit + zeiten.pausenzeit)) * plaetze;
      Severity: Minor
      Found in src/public/templates/event/spielplan/spielplan.ui.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

                   if (index >= 0 && (data.delay || (data.delay === 0 && valBefore && valBefore !== 0)) && !_.isNaN(data.delay)) {
                       vm.delays[index] = data.delay;
                       recalculateDateTimePlatz()
                   }
        Severity: Major
        Found in src/public/templates/event/spielplan/spielplan.ui.js - About 40 mins to fix

          There are no issues that match your filters.

          Category
          Status