prefeiturasp/SME-PratoAberto-Frontend

View on GitHub

Showing 27 of 72 total issues

File markerclusterer.js has 561 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @name MarkerClusterer for Google Maps v3
 * @version version 1.0.1
 * @author Luke Mahe
 * @fileoverview
Severity: Major
Found in src/app/vendors/markerclusterer.js - About 1 day to fix

    File datepicker.component.ts has 379 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { Globals } from './../app.globals';
    import { AppUtils } from './../app.utils';
    import { WindowRef } from './../WindowRef';
    import { Component, Input, Output, EventEmitter, OnInit, OnChanges, SimpleChange, ElementRef, AfterViewInit } from '@angular/core';
    import {MyDate, MyMonth} from './datepicker.component.interface';
    Severity: Minor
    Found in src/app/datepicker/datepicker.component.ts - About 5 hrs to fix

      Function createMonth has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

          createMonth(m:number, y:number): void {
              this.dates.length = 0;
              this.olderCount = 0;
              let monthStart = this.monthStartIdx(y, m);
              let dInThisM = this.daysInMonth(m, y);
      Severity: Minor
      Found in src/app/datepicker/datepicker.component.ts - About 4 hrs 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

      File school.component.ts has 309 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { CalendaryService } from './../calendary.service';
      import { Globals } from './../app.globals';
      import { Component, OnInit, ɵConsole } from '@angular/core';
      import { ActivatedRoute, Router } from '@angular/router';
      import { DatePipe } from '@angular/common';
      Severity: Minor
      Found in src/app/school/school.component.ts - About 3 hrs to fix

        DatepickerComponent has 24 functions (exceeds 20 allowed). Consider refactoring.
        Open

        @Component({
            selector: 'responsive-date-picker',
            templateUrl: './datepicker.component.html',
            styleUrls: ['./datepicker.component.scss']
        })
        Severity: Minor
        Found in src/app/datepicker/datepicker.component.ts - About 2 hrs to fix

          SchoolComponent has 24 functions (exceeds 20 allowed). Consider refactoring.
          Open

          @Component({
            selector: 'app-school',
            templateUrl: './school.component.html',
            styleUrls: ['./school.component.scss']
          })
          Severity: Minor
          Found in src/app/school/school.component.ts - About 2 hrs to fix

            Function ngOnInit has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                ngOnInit() {
                  this.dayLabels = this.options.dayLabels !== undefined ? this.options.dayLabels : this.dayLabels;
                  this.monthLabels = this.options.monthLabels !== undefined ? this.options.monthLabels : this.monthLabels;
                  this.dateFormat = this.options.dateFormat !== undefined ? this.options.dateFormat : this.dateFormat;
                  this.todayBtnTxt = this.options.todayBtnTxt !== undefined ? this.options.todayBtnTxt : this.todayBtnTxt;
            Severity: Minor
            Found in src/app/datepicker/datepicker.component.ts - About 2 hrs 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 createMonth has 63 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                createMonth(m:number, y:number): void {
                    this.dates.length = 0;
                    this.olderCount = 0;
                    let monthStart = this.monthStartIdx(y, m);
                    let dInThisM = this.daysInMonth(m, y);
            Severity: Major
            Found in src/app/datepicker/datepicker.component.ts - About 2 hrs to fix

              Function getCalendary has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                getCalendary(date, unit, attendance, grouping) {
                  let self = this;
                  console.log(self.currentSchool.nome);
                  //this.calendaryService.get(date, unit, attendance, grouping)
                  this.calendaryService.getWithSchool(date, unit, attendance, grouping,self.currentSchool.nome)
              Severity: Major
              Found in src/app/school/school.component.ts - About 2 hrs to fix

                Function createCarousel has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    createCarousel(){
                      this.timelineCarousel = this.winRef.nativeWindow.$(".timeline-carousel").owlCarousel({
                        center: true,
                        items: 4,
                        dots: false,
                Severity: Minor
                Found in src/app/datepicker/datepicker.component.ts - About 1 hr to fix

                  Function MarkerClusterer has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function MarkerClusterer(map, opt_markers, opt_options) {
                    // MarkerClusterer implements google.maps.OverlayView interface. We use the
                    // extend function to extend MarkerClusterer with google.maps.OverlayView
                    // because it might not always be available when the code is defined so we
                    // look for it at the last possible moment. If it doesn't exist now then
                  Severity: Minor
                  Found in src/app/vendors/markerclusterer.js - About 1 hr to fix

                    Function ngOnInit has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        ngOnInit() {
                          this.dayLabels = this.options.dayLabels !== undefined ? this.options.dayLabels : this.dayLabels;
                          this.monthLabels = this.options.monthLabels !== undefined ? this.options.monthLabels : this.monthLabels;
                          this.dateFormat = this.options.dateFormat !== undefined ? this.options.dateFormat : this.dateFormat;
                          this.todayBtnTxt = this.options.todayBtnTxt !== undefined ? this.options.todayBtnTxt : this.todayBtnTxt;
                    Severity: Minor
                    Found in src/app/datepicker/datepicker.component.ts - About 1 hr to fix

                      Function ngAfterViewInit has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        ngAfterViewInit() {
                          if (Globals.schools.length === 0) {
                            this.onLoadSchools();
                            this.doc.getElementById('overlay_search').style.display = 'block';
                          } else {
                      Severity: Minor
                      Found in src/app/search/search.component.ts - About 1 hr to fix

                        Function exports has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        module.exports = function (config) {
                          config.set({
                            basePath: '',
                            frameworks: ['jasmine', '@angular-devkit/build-angular'],
                            plugins: [
                        Severity: Minor
                        Found in karma.conf.js - About 1 hr to fix

                          Function createCss has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                          ClusterIcon.prototype.createCss = function(pos) {
                            var style = [];
                            style.push('background-image:url(' + this.url_ + ');');
                            var backgroundPosition = this.backgroundPosition_ ? this.backgroundPosition_ : '0 0';
                            style.push('background-position:' + backgroundPosition + ';');
                          Severity: Minor
                          Found in src/app/vendors/markerclusterer.js - About 1 hr 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 getCurrentSchool has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            getCurrentSchool(_id) {
                              let self = this;
                              this.schoolsService.getById(_id)
                                .subscribe(function (res) {
                                  self.currentSchool = res;
                          Severity: Minor
                          Found in src/app/school/school.component.ts - About 1 hr to fix

                            Function addMarker has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            Cluster.prototype.addMarker = function(marker) {
                              if (this.isMarkerAlreadyAdded(marker)) {
                                return false;
                              }
                            
                            
                            Severity: Minor
                            Found in src/app/vendors/markerclusterer.js - About 1 hr to fix

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

                              ClusterIcon.prototype.createCss = function(pos) {
                                var style = [];
                                style.push('background-image:url(' + this.url_ + ');');
                                var backgroundPosition = this.backgroundPosition_ ? this.backgroundPosition_ : '0 0';
                                style.push('background-position:' + backgroundPosition + ';');
                              Severity: Minor
                              Found in src/app/vendors/markerclusterer.js - About 1 hr to fix

                                Function addMarker has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                Cluster.prototype.addMarker = function(marker) {
                                  if (this.isMarkerAlreadyAdded(marker)) {
                                    return false;
                                  }
                                
                                
                                Severity: Minor
                                Found in src/app/vendors/markerclusterer.js - About 1 hr 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 onPrintPage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  onPrintPage() {
                                    let currWeekByDate = this.getWeekByDate(
                                      new Date(
                                        Globals.calendaryDate["year"],
                                        Globals.calendaryDate["month"] - 1,
                                Severity: Minor
                                Found in src/app/school/school.component.ts - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language