fga-eps-mds/2019.2-Vsign

View on GitHub

Showing 511 of 511 total issues

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

  def what_document? ()    
    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.

Assignment Branch Condition size for what_document? is too high. [22.16/15]
Open

  def what_document? ()    
    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 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. [17/10]
Open

  def execute
    variables = ensure_hash(params[:variables])
    query = params[:query]
    operation_name = params[:operationName]
    context = {

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. [16/10]
Open

  def perform(contract_id)
    @contract = Contract.find(contract_id)
    @script = @contract.script

    @user = @contract.user

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 id_confirm is too high. [20.78/15]
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 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

Assignment Branch Condition size for face_matching is too high. [19.42/15]
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 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

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

                                <Timeline.Item dot={<Icon icon="check-circle" style={{ color: '#ff6583' }} />}>
                                      <StepTitle>Integração</StepTitle>
                                      <StepText>Integre seu sistema com a Vsign através de nossa API.</StepText>
                                </Timeline.Item>
Severity: Major
Found in frontend/src/components/LandingPage/HowItWorks.js and 3 other locations - About 2 hrs to fix
frontend/src/components/LandingPage/HowItWorks.js on lines 25..28
frontend/src/components/LandingPage/HowItWorks.js on lines 29..32
frontend/src/components/LandingPage/HowItWorks.js on lines 33..36

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

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

                                <Timeline.Item dot={<Icon icon="info-circle" style={{ color: '#ff6583' }} />}>
                                    <StepTitle>Assinatura</StepTitle>
                                    <StepText>Seus clientes realizam a assinatura através da gravação de um vídeo em nossa plataforma.</StepText>
                                </Timeline.Item>
Severity: Major
Found in frontend/src/components/LandingPage/HowItWorks.js and 3 other locations - About 2 hrs to fix
frontend/src/components/LandingPage/HowItWorks.js on lines 21..24
frontend/src/components/LandingPage/HowItWorks.js on lines 25..28
frontend/src/components/LandingPage/HowItWorks.js on lines 33..36

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

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

                                <Timeline.Item dot={<Icon icon="check-circle" style={{ color: '#6d64fe' }} />}>
                                    <StepTitle>Resultado</StepTitle>
                                    <StepText>Notificamos você logo após a assinatura do contrato.</StepText>
                                </Timeline.Item>
Severity: Major
Found in frontend/src/components/LandingPage/HowItWorks.js and 3 other locations - About 2 hrs to fix
frontend/src/components/LandingPage/HowItWorks.js on lines 21..24
frontend/src/components/LandingPage/HowItWorks.js on lines 25..28
frontend/src/components/LandingPage/HowItWorks.js on lines 29..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 77.

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

                                <Timeline.Item dot={<Icon icon="exclamation-triangle" style={{ color: '#6d64fe' }} />}>
                                    <StepTitle>Envio</StepTitle>
                                    <StepText>Envie seus contratos para nossa plataforma.</StepText>
                                </Timeline.Item>
Severity: Major
Found in frontend/src/components/LandingPage/HowItWorks.js and 3 other locations - About 2 hrs to fix
frontend/src/components/LandingPage/HowItWorks.js on lines 21..24
frontend/src/components/LandingPage/HowItWorks.js on lines 29..32
frontend/src/components/LandingPage/HowItWorks.js on lines 33..36

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

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

                        <Button
                            style={{
                                fontSize: 22
                            }}
                            appearance="primary"
Severity: Major
Found in frontend/src/components/DocumentPage/index.js and 1 other location - About 2 hrs to fix
frontend/src/components/DocumentPage/index.js on lines 104..113

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

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

                    <Button
                        style={{
                            fontSize: 18
                        }}
                        appearance="primary"
Severity: Major
Found in frontend/src/components/DocumentPage/index.js and 1 other location - About 2 hrs to fix
frontend/src/components/DocumentPage/index.js on lines 61..70

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

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

export default function Instructions() {
    return (
        <div className="container">
            <div className="row">
                <div className="col-12">
Severity: Minor
Found in frontend/src/components/InstructionsPage/Instructions.js - About 1 hr to fix

    Assignment Branch Condition size for resolve is too high. [17.46/15]
    Open

        def resolve(contract_id: nil, files: nil)
          current_user = context[:current_user]
          contract = current_user.contracts.find(contract_id)
    
          files = files.to_h

    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

    Perceived complexity for gettext is too high. [9/7]
    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 tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

    Example:

    def my_method                   # 1
      if cond                       # 1
        case var                    # 2 (0.8 + 4 * 0.2, rounded)
        when 1 then func_one
        when 2 then func_two
        when 3 then func_three
        when 4..10 then func_other
        end
      else                          # 1
        do_something until a && b   # 2
      end                           # ===
    end                             # 7 complexity points

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

        componentDidUpdate(prevProps, prevState) {
            if(prevProps.record !== this.props.record) {
                if (this.props.record) {
                    this.startRecording();
                } else {
    Severity: Major
    Found in frontend/src/components/RecordPage/AudioRecording.js and 1 other location - About 1 hr to fix
    frontend/src/components/RecordPage/Video.js on lines 62..70

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

    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

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

        componentDidUpdate(prevProps, prevState) {
            if(prevProps.record !== this.props.record) {
                if (this.props.record) {
                    this.startRecording();
                } else {
    Severity: Major
    Found in frontend/src/components/RecordPage/Video.js and 1 other location - About 1 hr to fix
    frontend/src/components/RecordPage/AudioRecording.js on lines 21..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 72.

    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

    Method has too many lines. [11/10]
    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 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. [11/10]
    Open

        def resolve(contract_id: nil, files: nil)
          current_user = context[:current_user]
          contract = current_user.contracts.find(contract_id)
    
          files = files.to_h

    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. [11/10]
    Open

        def perform(contract_id)
            
            @contract = Contract.find(contract_id)
            template_id = nil
    
    

    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