Ontica/Empiria.Land.Intranet

View on GitHub

Showing 370 of 516 total issues

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

      case SelectorType.REAL_ESTATE_PARTITION_KIND_LIST:
        provider = () => this.data.getRealEstatePartitionKinds();

        return super.selectFirst<U>(selectorType, provider);
src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 77..80
src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 99..102
src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 105..108
src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 117..120
src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 123..126
src/app/presentation/land/transaction.presentation.handler.ts on lines 124..127
src/app/presentation/land/transaction.presentation.handler.ts on lines 129..132
src/app/presentation/land/transaction.presentation.handler.ts on lines 134..137

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 47.

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 9 locations. Consider refactoring.
Open

      case SelectorType.REAL_ESTATE_LOT_SIZE_UNIT_LIST:
        provider = () => this.data.getRealEstateLotSizeUnits();

        return super.selectFirst<U>(selectorType, provider);
src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 77..80
src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 99..102
src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 105..108
src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 111..114
src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 123..126
src/app/presentation/land/transaction.presentation.handler.ts on lines 124..127
src/app/presentation/land/transaction.presentation.handler.ts on lines 129..132
src/app/presentation/land/transaction.presentation.handler.ts on lines 134..137

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 47.

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 9 locations. Consider refactoring.
Open

      case SelectorType.RECORDER_OFFICE_LIST:
        provider = () => this.data.getRecorderOffices();

        return super.selectFirst<U>(selectorType, provider);
src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 77..80
src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 99..102
src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 105..108
src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 111..114
src/app/presentation/land/recordable-subjects.presentation.handler.ts on lines 117..120
src/app/presentation/land/transaction.presentation.handler.ts on lines 124..127
src/app/presentation/land/transaction.presentation.handler.ts on lines 129..132
src/app/presentation/land/transaction.presentation.handler.ts on lines 134..137

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 47.

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

export enum DataTableColumnType {
  text        = 'text',
  text_link   = 'text-link',
  text_nowrap = 'text-nowrap',
  decimal     = 'decimal',
Severity: Minor
Found in src/app/models/_data-table.ts and 2 other locations - About 35 mins to fix
src/app/presentation/land/registration.presentation.handler.ts on lines 20..29
src/app/views/transactions/transaction-header/transaction-header.component.ts on lines 23..32

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 47.

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

  private setTractIndexEntrySelected(tractIndexEntry: TractIndexEntry) {
    this.tractIndexEntrySelected = tractIndexEntry;
    this.displayRecordingActEdition = !isEmpty(this.tractIndexEntrySelected);
  }
src/app/workspaces/historic-registration/historic-registration-main-page/historic-registration-main-page.component.ts on lines 115..118
src/app/workspaces/land-transactions/transactions-main-page/parts/land-certification.component.ts on lines 195..198

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 47.

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 validateSelectBookEntryRule has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  private validateSelectBookEntryRule(data: CreateCertificateCommandPayload) {
    if (this.certificateRulesSelected.selectBookEntry) {
      const formModel = this.form.getRawValue();

      data.recordingBookUID = formModel.recordingBook.uid ?? '';
Severity: Minor
Found in src/app/views/certificate-emission/certificate-creator.component.ts - About 35 mins 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 validateSelectBookEntryRule has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  private validateSelectBookEntryRule(data: RegistrationCommandPayload) {
    if (this.registrationCommandRules.selectBookEntry) {
      const formModel = this.form.getRawValue();

      data.recordingBookUID = formModel.recordingBook.uid ?? '';

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 includesAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  static includesAll(source: string, keywords: string): boolean {
    if (!source || StringLibrary.trimAll(source).length === 0) {
      return false;
    }
    if (!keywords || StringLibrary.trimAll(keywords).length === 0) {
Severity: Minor
Found in src/app/core/data-types/string-library.ts - About 35 mins 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 compareDates has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  static compareDates(value1: DateString, value2: DateString): number {
    const date1 = this.datePart(value1);
    const date2 = this.datePart(value2);

    if (date1 && date2) {
Severity: Minor
Found in src/app/core/data-types/date-string-library.ts - About 35 mins 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 getMenuOptions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  private getMenuOptions(file: FileData): FileControlMenuOptions[] {
    if (file.uid) {
      const options: FileControlMenuOptions[] = [];

      if (this.validateShowOption(file.type)) {
Severity: Minor
Found in src/app/shared/form-controls/file-control/file-control.component.ts - About 35 mins 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 newPasswordErrorsText has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  get newPasswordErrorsText(): string {
    const errors = this.getNewPasswordErrorsList();
    const isMatchError = this.form.errors?.matchOther && this.isRequiredAction;
    let errorText = '';

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 getDefaultRoute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  private getDefaultRoute(permissions: string[]): string {
    if (permissions.includes(DEFAULT_ROUTE.permission)) {
      return DEFAULT_PATH;
    }

Severity: Minor
Found in src/app/core/security/authentication.service.ts - About 35 mins 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 convertTo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  static convertTo(sourceErr: any, defaultMessage?: string): Exception {
    if (!sourceErr) {
      return new Exception(defaultMessage || `Error con valor 'undefined' o 'null'.`); // 'UNDEFINED_ERROR'

    } else if (sourceErr instanceof HttpErrorResponse) {
Severity: Minor
Found in src/app/core/general/exception.ts - About 35 mins 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 getPayloadDataField has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  private getPayloadDataField(path: string, options: HttpClientOptions, service: Service): string {
    if (options && options.dataField) {
      return options.dataField;

    } else if (options && options.dataField === null) {
Severity: Minor
Found in src/app/core/http/http-handler.ts - About 35 mins 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

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

  ngOnChanges(changes: SimpleChanges) {
    if (changes.transactionUID) {
      this.unsuscribePreprocessingData();
      this.getPreprocessingData();
    }
src/app/views/transactions/transaction-files/transaction-files.component.ts on lines 52..57
src/app/workspaces/land-transactions/transactions-main-page/parts/land-certification.component.ts on lines 63..68

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 46.

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

  ngOnChanges(changes: SimpleChanges) {
    if (changes.mediaFiles) {
      this.resetFileControls();
      this.mapFileDataFromMediaFile();
    }
src/app/workspaces/land-transactions/transactions-main-page/parts/land-certification.component.ts on lines 63..68
src/app/workspaces/land-transactions/transactions-main-page/parts/land-pre-registration.component.ts on lines 51..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 46.

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.executeCommand<PreprocessingData>(TransactionCommandType.REMOVE_TRANSACTION_FILE, event.payload)
          .then(x => this.preprocessingData = x);
src/app/workspaces/land-transactions/transactions-main-page/parts/land-pre-registration.component.ts on lines 72..73

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 46.

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.executeCommand<PreprocessingData>(TransactionCommandType.UPLOAD_TRANSACTION_FILE, event.payload)
          .then(x => this.preprocessingData = x);
src/app/workspaces/land-transactions/transactions-main-page/parts/land-pre-registration.component.ts on lines 81..82

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 46.

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

export interface CertificateRules {
  subjectType: RecordableSubjectType;
  selectSubject: boolean;
  selectBookEntry: boolean;
  givePersonName: boolean;
Severity: Minor
Found in src/app/models/certificate.ts and 1 other location - About 35 mins to fix
src/app/models/registration.ts on lines 144..150

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 46.

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

  ngOnChanges(changes: SimpleChanges) {
    if (changes.transactionUID) {
      this.getTransactionCertificates();
      this.resetPanelState();
    }
src/app/views/transactions/transaction-files/transaction-files.component.ts on lines 52..57
src/app/workspaces/land-transactions/transactions-main-page/parts/land-pre-registration.component.ts on lines 51..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 46.

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