Ontica/Empiria.Land.Intranet

View on GitHub

Showing 370 of 516 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    if (!!this.form.value.billTo || !!this.form.value.rfc) {
      this.formHelper.setControlValidators(this.form.controls.billTo, Validators.required);
      this.formHelper.setControlValidators(this.form.controls.rfc,
        [Validators.required, Validators.minLength(12), Validators.maxLength(13)]);
    } else {
src/app/views/registration/recording-acts/recording-act-creator.component.ts on lines 343..349

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  onESignExplorerEvent(event: EventInfo) {
    switch (event.type as LandExplorerEventType) {

      case LandExplorerEventType.RECEIVE_ITEMS_CLICKED:
        this.displayWorkflowCommanderOption = WorkflowCommanderOptions.ReceiveTransactions;

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

      onTransactionExplorerEvent(event: EventInfo) {
        switch (event.type as LandExplorerEventType) {
    
          case LandExplorerEventType.CREATE_ITEM_CLICKED:
            this.displayOptionModalSelected = 'CreateTransactionEditor';

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

        getContexts(): EmpObservable<Identifiable[]> {
          const path = `v4/onepoint/security/management/contexts`;
      
          return this.http.get<Identifiable[]>(path);
        }
      Severity: Major
      Found in src/app/data-services/_access-control.data.service.ts and 7 other locations - About 1 hr to fix
      src/app/data-services/_access-control.data.service.ts on lines 21..25
      src/app/data-services/recordable-subjects.data.service.ts on lines 96..100
      src/app/data-services/recordable-subjects.data.service.ts on lines 103..107
      src/app/data-services/transaction.data.service.ts on lines 22..26
      src/app/data-services/transaction.data.service.ts on lines 29..33
      src/app/data-services/transaction.data.service.ts on lines 45..49
      src/app/data-services/transaction.data.service.ts on lines 52..56

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 57.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

        getWorkareas(): EmpObservable<Identifiable[]> {
          const path = `v4/onepoint/security/management/subjects/workareas`;
      
          return this.http.get<Identifiable[]>(path);
        }
      Severity: Major
      Found in src/app/data-services/_access-control.data.service.ts and 7 other locations - About 1 hr to fix
      src/app/data-services/_access-control.data.service.ts on lines 28..32
      src/app/data-services/recordable-subjects.data.service.ts on lines 96..100
      src/app/data-services/recordable-subjects.data.service.ts on lines 103..107
      src/app/data-services/transaction.data.service.ts on lines 22..26
      src/app/data-services/transaction.data.service.ts on lines 29..33
      src/app/data-services/transaction.data.service.ts on lines 45..49
      src/app/data-services/transaction.data.service.ts on lines 52..56

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 57.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

        private static tryParse(value: string): Date {
          const dateParts: string[] = this.tryToConvertToDatePartsArray(value);
      
          if (!dateParts) {
            return null;
      Severity: Minor
      Found in src/app/core/data-types/date-string-library.ts - 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 initTexts has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

        private initTexts(){
          this.cardTitle = this.displayRecordingAct ? 'Editor del acto jurídico' : 'Editor ';
          this.tabEditorLabel = 'Datos ';
      
          if (this.isRealEstate) {

      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 onRecordingBookSelectorEvent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        onRecordingBookSelectorEvent(event: EventInfo){
      
          switch (event.type as RecordingBookSelectorEventType) {
      
            case RecordingBookSelectorEventType.RECORDING_BOOK_CHANGED:

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        @Component({
          selector: 'emp-ng-date-range-picker',
          templateUrl: 'date-range-picker.component.html',
          styleUrls: ['date-range-picker.component.scss'],
          providers: [
        src/app/shared/form-controls/date-picker/date-picker.component.ts on lines 15..145
        src/app/shared/form-controls/input-numeric/input-numeric.component.ts on lines 15..116

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 56.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        @Component({
          selector: 'emp-ng-input-numeric',
          templateUrl: 'input-numeric.component.html',
          styleUrls: ['input-numeric.component.scss'],
          providers: [
        src/app/shared/form-controls/date-picker/date-picker.component.ts on lines 15..145
        src/app/shared/form-controls/date-range-picker/date-range-picker.component.ts on lines 36..331

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 56.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        @Component({
          selector: 'emp-ng-datepicker',
          templateUrl: 'date-picker.component.html',
          styleUrls: ['date-picker.component.scss'],
          providers: [
        src/app/shared/form-controls/date-range-picker/date-range-picker.component.ts on lines 36..331
        src/app/shared/form-controls/input-numeric/input-numeric.component.ts on lines 15..116

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 56.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

          private getServiceFromList(servicePathOrUID: string,
                                     method: HttpMethod): Observable<Service> {
            let condition: (Service) => boolean;
        
            if (servicePathOrUID.includes('/')) {
        Severity: Minor
        Found in src/app/core/http/directory.service.ts - About 1 hr to fix

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

                case SelectorType.AMENDABLE_RECORDING_ACTS:
                  Assertion.assertValue(params.query, 'params.query');
          
                  return this.data.getAmendableRecordingActs(params.query) as EmpObservable<U>;
          src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 137..140
          src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 142..145
          src/app/presentation/land/registration.presentation.handler.ts on lines 100..103
          src/app/presentation/land/registration.presentation.handler.ts on lines 105..108

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 55.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

                case SelectorType.RECORDING_ACT_TYPES_LIST_FOR_RECORDABLE_SUBJECT:
                  Assertion.assertValue(params.recordableSubjectUID, 'params.recordableSubjectUID');
          
                  return this.data.getRecordingActTypesForRecordableSubject(params.recordableSubjectUID) as EmpObservable<U>;
          src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 71..74
          src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 137..140
          src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 142..145
          src/app/presentation/land/registration.presentation.handler.ts on lines 100..103

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 55.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

                case SelectorType.RECORDING_ACT_TYPES_LIST_FOR_INSTRUMENT:
                  Assertion.assertValue(params.instrumentUID, 'params.instrumentUID');
          
                  return this.data.getRecordingActTypesForInstrument(params.instrumentUID) as EmpObservable<U>;
          src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 71..74
          src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 137..140
          src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 142..145
          src/app/presentation/land/registration.presentation.handler.ts on lines 105..108

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 55.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

                case SelectorType.TRACT_INDEX:
                  Assertion.assertValue(params.recordableSubjectUID, 'params.recordableSubjectUID');
          
                  return this.data.getFullTractIndex(params.recordableSubjectUID) as EmpObservable<U>;
          src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 71..74
          src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 137..140
          src/app/presentation/land/registration.presentation.handler.ts on lines 100..103
          src/app/presentation/land/registration.presentation.handler.ts on lines 105..108

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 55.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

                case SelectorType.RECORDING_BOOK_ENTRIES_LIST:
                  Assertion.assertValue(params.recordingBookUID, 'params.recordingBookUID');
          
                  return this.data.getRecordingBookEntries(params.recordingBookUID) as EmpObservable<U>;
          src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 71..74
          src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 142..145
          src/app/presentation/land/registration.presentation.handler.ts on lines 100..103
          src/app/presentation/land/registration.presentation.handler.ts on lines 105..108

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 55.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            ngOnChanges(changes: SimpleChanges) {
              if (changes.recordingActs) {
                this.dataSource = new MatTableDataSource(this.recordingActs);
              }
          
          
          src/app/views/transactions/transaction-editor/requested-services/requested-service-list.component.ts on lines 50..56

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 55.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              this.agencyList = isEmpty(this.transaction.agency) ? this.agencyList :
                ArrayLibrary.insertIfNotExist(this.agencyList, this.transaction.agency, 'uid');
          src/app/views/transactions/transaction-editor/transaction-editor.component.ts on lines 270..271

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 55.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              this.filingOfficeList = isEmpty(this.transaction.filingOffice) ? this.filingOfficeList :
                ArrayLibrary.insertIfNotExist(this.filingOfficeList, this.transaction.filingOffice, 'uid');
          src/app/views/transactions/transaction-editor/transaction-editor.component.ts on lines 273..274

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 55.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Severity
          Category
          Status
          Source
          Language