RomainMarecat/slate

View on GitHub

Showing 93 of 98 total issues

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

save() {
if (this.form.valid) {
if (this.cart) {
this.cart.updated_at = new Date();
this.isSaving = true;
Severity: Minor
Found in src/shared/cart/cart-edit/cart-edit.component.ts - About 1 hr to fix

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

    createForm(product: Product, offers: Array<Offer> = []): FormGroup {
    this.form = new FormGroup({
    name: new FormControl(product && product.name ? product.name : '', [
    Validators.required,
    ]),
    Severity: Minor
    Found in src/shared/admin/shared/product/form-product.ts - About 1 hr to fix

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

      onLogin() {
      this.userService.getLoginGoogle()
      .then((result) => {
      const user = result.user;
      if (user) {
      Severity: Minor
      Found in src/shared/cart/cart-wrapper/cart-wrapper.component.ts - About 1 hr to fix

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

        static getForm(): FormGroup {
        return new FormGroup({
        brand: new FormControl('', [Validators.required]),
        model: new FormControl({value: '', disabled: true}, [Validators.required]),
        product: new FormControl({value: '', disabled: true}, [Validators.required]),
        Severity: Minor
        Found in src/app-car/offer-edit/offer-edit/offer-edit.component.ts - About 1 hr to fix

          Function getColumns has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          getColumns(): TableColumn[] {
          return [{
          width: 75,
          sortable: false,
          canAutoResize: false,
          Severity: Minor
          Found in src/shared/admin/map/map-areas/map-areas.component.ts - About 1 hr to fix

            Function getForm has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            static getForm(): FormGroup {
            return new FormGroup({
            firstname: new FormControl('', [
            Validators.required,
            Validators.minLength(1),
            Severity: Minor
            Found in src/shared/user/register/register1/register1.component.ts - About 1 hr to fix

              Function createForm has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              createForm() {
              this.form = new FormGroup({
              name: new FormControl('', [
              Validators.required,
              ]),
              Severity: Minor
              Found in src/shared/admin/category/category-add/category-add.component.ts - About 1 hr to fix

                Function getColumns has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                getColumns(): Observable<TableColumn[]> {
                return new Observable(observer => {
                observer.next([
                {
                prop: 'key',

                  Function getForm has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  static getForm(): FormGroup {
                  return new FormGroup({
                  number: new FormControl('', [
                  Validators.required,
                  Validators.minLength(12),
                  Severity: Minor
                  Found in src/shared/payment/shared/payment.ts - About 1 hr to fix

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

                    addInverseBrowserUserAgent() {
                    if ((this.isChrome) && (this.isSafari)) {
                    this.isSafari = false;
                    }
                    if ((this.isChrome) && ((this.isEdgeDesktop) ||
                    Severity: Minor
                    Found in src/shared/a2hs/shared/a2hs.service.ts - About 1 hr to fix

                    Function getColumns has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    getColumns(): TableColumn[] {
                    return [{
                    width: 75,
                    sortable: false,
                    canAutoResize: false,
                    Severity: Minor
                    Found in src/shared/admin/partner/partner-list/partner-list.component.ts - About 1 hr to fix

                      Function createOfferForm has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      static createOfferForm(product ?: Product, offers: Array<Offer> = []): FormArray {
                      const offersForm: FormArray = new FormArray([new FormControl()]);
                      if (product && product.offers && product.offers.length > 0) {
                      product.offers.forEach((offer: string) => {
                      offersForm.push(ProductFormType.newOffer());
                      Severity: Minor
                      Found in src/shared/admin/shared/product/form-product.ts - About 1 hr to fix

                        Function getItems has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        static getItems(): Item[] {
                        return [
                        {
                        type: 'avatar',
                        title: 'Users Joined Today',
                        Severity: Minor
                        Found in src/shared/timeline/timeline/timeline.component.ts - About 1 hr to fix

                          Function createForm has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          createForm(product: Product, offers: Array<Offer> = []): FormGroup {
                          this.form = new FormGroup({
                          name: new FormControl(product && product.name ? product.name : '', [
                          Validators.required,
                          ]),
                          Severity: Minor
                          Found in src/shared/admin/shared/product/form-product.ts - About 55 mins to fix

                          Function getChildForm has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          static getChildForm(type: string, delivery: Delivery = null): FormGroup {
                          return new FormGroup({
                          email: new FormControl(delivery && delivery[type] && delivery[type].email ? delivery[type].email : '',
                          [Validators.required, Validators.minLength(1), Validators.email]
                          ),
                          Severity: Minor
                          Found in src/shared/cart/cart-delivery/cart-delivery.component.ts - About 45 mins to fix

                          Function scrollOnInstructions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          scrollOnInstructions(filteredInstructions: Constraint[], bottom: number) {
                          this.limitInstructionReached = false;
                          if (filteredInstructions.length > 0) {
                          this.currentInstruction = filteredInstructions[0].index;
                          // If scroll bottom
                          Severity: Minor
                          Found in src/app-recipe/recipe-detail/recipe-detail/recipe-detail.component.ts - About 45 mins to fix

                          Function findOneBy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          findOneBy(object: Selection, column: string = 'id', value: string) {
                          if (object[column] === value) {
                          return object;
                          }
                          let result;
                          Severity: Minor
                          Found in src/app-hockey/selection/selection-list/selection-list.component.ts - About 45 mins to fix

                          Function getShipping has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          getShipping(order: Order) {
                          if (order.key) {
                          this.shippingService.filters$.next([
                          {
                          column: 'order',
                          Severity: Minor
                          Found in src/shared/order/order-detail/order-detail.component.ts - About 45 mins to fix

                          Function getPayment has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          getPayment(order: Order) {
                          if (order.key) {
                          this.paymentService.filters$.next([
                          {
                          column: 'order',
                          Severity: Minor
                          Found in src/shared/order/order-detail/order-detail.component.ts - About 45 mins to fix

                          Function applyOrder has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          applyOrder(product: Product, body: Product): Product {
                          if (body.ordered) {
                          if (product.ordered) {
                          product.ordered += body.ordered;
                          } else {
                          Severity: Minor
                          Found in src/shared/product/shared/product.service.ts - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language