fga-eps-mds/2019.2-Vsign

View on GitHub

Showing 511 of 511 total issues

Assignment Branch Condition size for gettext is too high. [45.32/15]
Open

  def gettext(document_photo)
    client = Aws::Rekognition::Client.new({
      region: Rails.application.credentials.dig(:aws, :region),
      credentials: Aws::Credentials.new(
        Rails.application.credentials.dig(:aws, :access_key_id),
Severity: Minor
Found in backend/app/jobs/id_check_job.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method has too many lines. [37/10]
Open

  def gettext(document_photo)
    client = Aws::Rekognition::Client.new({
      region: Rails.application.credentials.dig(:aws, :region),
      credentials: Aws::Credentials.new(
        Rails.application.credentials.dig(:aws, :access_key_id),
Severity: Minor
Found in backend/app/jobs/id_check_job.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

    try {
        // Inicia upload do áudio.
        yield put(setAudioUploadStatusAction({
            uploading: true
        }));
Severity: Major
Found in frontend/src/sagas/upload.js and 1 other location - About 4 hrs to fix
frontend/src/sagas/upload.js on lines 22..47

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

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

    try {

        // Inicia upload do áudio.
        yield put(setVideoUploadStatusAction({
            uploading: true
Severity: Major
Found in frontend/src/sagas/upload.js and 1 other location - About 4 hrs to fix
frontend/src/sagas/upload.js on lines 55..79

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

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

Block has too many lines. [73/25]
Open

ActiveRecord::Schema.define(version: 2019_11_28_172416) do

  # These are extensions that must be enabled in order to support this database
  enable_extension "plpgsql"

Severity: Minor
Found in backend/db/schema.rb by rubocop

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

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

            <div className="row my-5 py-5">
                <div className="col-4 text-right pt-3">
                    <h2 className="display-5">3 - Assinatura</h2>
                    <p className="lead">Grave a sua assinatura, fazendo a leitura das legendas que aparecerão em sua tela.</p>
                </div>
Severity: Major
Found in frontend/src/components/InstructionsPage/Instructions.js and 1 other location - About 3 hrs to fix
frontend/src/components/InstructionsPage/Instructions.js on lines 14..22

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

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

            <div className="row mt-5 py-5">
                <div className="col-6 text-center">
                    <img src={CompletedIcon} width="80%" alt="Passo 4" />
                </div>
                <div className="col-4">
Severity: Major
Found in frontend/src/components/InstructionsPage/Instructions.js and 1 other location - About 3 hrs to fix
frontend/src/components/InstructionsPage/Instructions.js on lines 23..31

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

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

            <div className="row my-5 py-5">
                <div className="col-4 text-right">
                    <h2 className="display-5">1 - Revisão Contrato</h2>
                    <p className="lead">Verifique se o número do contrato está correto, em seguida, leia a prévia do roteiro e certifique-se que está tudo correto.</p>
                </div>
Severity: Major
Found in frontend/src/components/InstructionsPage/Instructions.js and 1 other location - About 3 hrs to fix
frontend/src/components/InstructionsPage/Instructions.js on lines 32..40

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

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

            <div className="row my-5 py-5">
                <div className="col-6 text-center">
                    <img src={CompletedIcon} width="80%" alt="Passo 2" />
                </div>
                <div className="col-4">
Severity: Major
Found in frontend/src/components/InstructionsPage/Instructions.js and 1 other location - About 3 hrs to fix
frontend/src/components/InstructionsPage/Instructions.js on lines 41..49

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

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

                    <FlexboxGrid.Item componentClass={Col} colspan={24} md={6}>
                    <Panel bordered header="Inicial" className="text-center">
                        <h3>R$ 10,00</h3>
                        <p>Por contrato assinado</p>
                        <small>até 100 contratos por mês</small>
Severity: Major
Found in frontend/src/components/LandingPage/Pricing.js and 1 other location - About 3 hrs to fix
frontend/src/components/LandingPage/Pricing.js on lines 23..29

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

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

                    <FlexboxGrid.Item componentClass={Col} colspan={24} md={6}>
                    <Panel bordered header="Avançado" className="text-center">
                        <h3>R$ 7,00</h3>
                        <p>Por contrato assinado</p>
                        <small>acima 100 contratos por mês</small>
Severity: Major
Found in frontend/src/components/LandingPage/Pricing.js and 1 other location - About 3 hrs to fix
frontend/src/components/LandingPage/Pricing.js on lines 16..22

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

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

    render() {
        const stepSize = (100 / (this.props.script).length)
        const steps = [
            {
                selector: '[data-tour="step0"]',
Severity: Major
Found in frontend/src/components/RecordPage/index.js - About 3 hrs to fix

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

                req.upload.addEventListener("load", event => {
                    const copy = { ...this.state.uploadProgress };
                    copy[file.name] = { state: "done", percentage: 100 };
                    this.setState({ uploadProgress: copy });
                    resolve(req.response);
    Severity: Major
    Found in frontend/src/components/DocumentPage/index.js and 1 other location - About 3 hrs to fix
    frontend/src/components/DocumentPage/index.js on lines 170..175

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

    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

                req.upload.addEventListener("error", event => {
                    const copy = { ...this.state.uploadProgress };
                    copy[file.name] = { state: "error", percentage: 0 };
                    this.setState({ uploadProgress: copy });
                    reject(req.response);
    Severity: Major
    Found in frontend/src/components/DocumentPage/index.js and 1 other location - About 3 hrs to fix
    frontend/src/components/DocumentPage/index.js on lines 163..168

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

    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

    Assignment Branch Condition size for perform is too high. [26.31/15]
    Open

      def perform(contract_id) 
        
        @client = Aws::Rekognition::Client.new({
          region: Rails.application.credentials.dig(:aws, :region),
          credentials: Aws::Credentials.new(
    Severity: Minor
    Found in backend/app/jobs/face_match_job.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Method has too many lines. [21/10]
    Open

      def face_matching(video_image, document_image)
       
        attrs = {
          source_image: {
            s3_object: {
    Severity: Minor
    Found in backend/app/jobs/face_match_job.rb by rubocop

    This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    Method has too many lines. [21/10]
    Open

      def perform(contract_id)
        @contract = Contract.find(contract_id)
    
        if @contract.audio.attached?
          binary = @contract.audio.download

    This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    Assignment Branch Condition size for perform is too high. [25.4/15]
    Open

      def perform(contract_id)
        @contract = Contract.find(contract_id)
    
        if @contract.audio.attached?
          binary = @contract.audio.download

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Method has too many lines. [20/10]
    Open

      def id_confirm(document_image)
        attrs = {
          image: {
            s3_object: {
              bucket: Rails.application.credentials[Rails.env.to_sym][:aws][:bucket],
    Severity: Minor
    Found in backend/app/jobs/id_confirm_job.rb by rubocop

    This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    Method has too many lines. [20/10]
    Open

      def change
        create_table :active_storage_blobs do |t|
          t.string   :key,        null: false
          t.string   :filename,   null: false
          t.string   :content_type

    This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    Severity
    Category
    Status
    Source
    Language