EasyRecon/Hunt3r

View on GitHub

Showing 134 of 138 total issues

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

  deleteMeshs(id:number): Observable<MeshResponse> {
    return this.httpService.delete<MeshData>('/admin/meshs/'+id)
  }
Severity: Major
Found in frontend/src/app/core/meshs/meshs.service.ts and 4 other locations - About 45 mins to fix
frontend/src/app/core/domains/domains.service.ts on lines 13..15
frontend/src/app/core/engines/engines.service.ts on lines 17..19
frontend/src/app/core/user/user.service.ts on lines 28..30
frontend/src/app/core/vulnerabilities/vulnerabilities.service.ts on lines 20..23

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

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

  deleteServers(uid:string): Observable<ServerData> {
    return this.httpService.delete<ServerData>('/servers/'+uid)
  }
Severity: Major
Found in frontend/src/app/core/server/server.service.ts and 3 other locations - About 45 mins to fix
frontend/src/app/core/bugbountyPlatform/bugbountyPlatform.service.ts on lines 23..25
frontend/src/app/core/cloudProvider/cloudProvider.service.ts on lines 14..16
frontend/src/app/core/nuclei/nuclei.service.ts on lines 14..16

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

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

  def build_scan_cmd(scan)
    scan_cmd = { cmd: 'ruby /tmp/tools/scan.rb' }
    hunt3r_token = Tool.find_by(name: 'hunt3r_token')&.infos
    scan_cmd[:errors] = 'hunt3r_token' if hunt3r_token.nil?

Severity: Minor
Found in backend/app/controllers/scans_controller.rb - About 45 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 5 locations. Consider refactoring.
Open

  deleteVulnerabilities(id:number): Observable<VulnerabilitiesDeleteResponse> {
    return this.httpService.delete<VulnerabilitiesDeleteResponse>('/vulnerabilities/'+id)

  }
frontend/src/app/core/domains/domains.service.ts on lines 13..15
frontend/src/app/core/engines/engines.service.ts on lines 17..19
frontend/src/app/core/meshs/meshs.service.ts on lines 24..26
frontend/src/app/core/user/user.service.ts on lines 28..30

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

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

  def create
    platform = Platform.find_by_name(params[:name])
    unless allowed_platform?(platform)
      return render status: 422, json: { message: I18n.t('errors.controllers.admin.invoices.unsupported_platform') }
    end
Severity: Minor
Found in backend/app/controllers/admin/invoice_controller.rb - About 45 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 4 locations. Consider refactoring.
Open

  deletePlatform(plateform:string): Observable<BugBountyPlatformSettingsResponse> {
    return this.httpService.delete<BugBountyPlatformSettingsResponse>('/admin/platforms/'+plateform)
  }
frontend/src/app/core/cloudProvider/cloudProvider.service.ts on lines 14..16
frontend/src/app/core/nuclei/nuclei.service.ts on lines 14..16
frontend/src/app/core/server/server.service.ts on lines 15..17

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

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

  deleteTemplate(name:string): Observable<NucleiResponse> {
    return this.httpService.delete<NucleiResponse>('/nuclei/'+name)
  }
Severity: Major
Found in frontend/src/app/core/nuclei/nuclei.service.ts and 3 other locations - About 45 mins to fix
frontend/src/app/core/bugbountyPlatform/bugbountyPlatform.service.ts on lines 23..25
frontend/src/app/core/cloudProvider/cloudProvider.service.ts on lines 14..16
frontend/src/app/core/server/server.service.ts on lines 15..17

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

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

  deleteUser(id:number): Observable<UserResponse> {
    return this.httpService.delete<UserResponse>('/admin/users/'+id)
  }
Severity: Major
Found in frontend/src/app/core/user/user.service.ts and 4 other locations - About 45 mins to fix
frontend/src/app/core/domains/domains.service.ts on lines 13..15
frontend/src/app/core/engines/engines.service.ts on lines 17..19
frontend/src/app/core/meshs/meshs.service.ts on lines 24..26
frontend/src/app/core/vulnerabilities/vulnerabilities.service.ts on lines 20..23

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

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

  def self.parse_scopes(scopes, slug, platform)
    program = Program.find_by(slug: slug)
    scopes.each do |scope|
      type = scope['type']
      next unless type == 1
Severity: Minor
Found in backend/lib/platforms/intigriti.rb - About 45 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 4 locations. Consider refactoring.
Open

  deleteCloud(platform:string): Observable<DeleteProviderResponse> {
    return this.httpService.delete<DeleteProviderResponse>('/admin/providers/'+platform)
  }
Severity: Major
Found in frontend/src/app/core/cloudProvider/cloudProvider.service.ts and 3 other locations - About 45 mins to fix
frontend/src/app/core/bugbountyPlatform/bugbountyPlatform.service.ts on lines 23..25
frontend/src/app/core/nuclei/nuclei.service.ts on lines 14..16
frontend/src/app/core/server/server.service.ts on lines 15..17

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

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

def ssh_key_valid?(provider)
  return false unless provider.infos['ssh_key']

  path = "/root/.ssh/#{provider.name}_id_rsa"
  dir = File.dirname(path)
Severity: Minor
Found in backend/app/controllers/admin/providers_controller.rb - About 45 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

Method parse_scopes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def self.parse_scopes(scopes, slug, platform)
    program = Program.find_by(slug: slug)
    scopes.each do |scope|
      type = scope['scope_type']
      next unless %w[web-application api].include?(type)
Severity: Minor
Found in backend/lib/platforms/yeswehack.rb - About 45 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 5 locations. Consider refactoring.
Open

  deleteEngine(id:number): Observable<AddEngineResponse> {
    return this.httpService.delete<AddEngineResponse>('/engines/'+id)
  }
Severity: Major
Found in frontend/src/app/core/engines/engines.service.ts and 4 other locations - About 45 mins to fix
frontend/src/app/core/domains/domains.service.ts on lines 13..15
frontend/src/app/core/meshs/meshs.service.ts on lines 24..26
frontend/src/app/core/user/user.service.ts on lines 28..30
frontend/src/app/core/vulnerabilities/vulnerabilities.service.ts on lines 20..23

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

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

  deleteDomain(id:number): Observable<DomainData> {
    return this.httpService.delete<DomainData>('/domains/'+id)
  }
Severity: Major
Found in frontend/src/app/core/domains/domains.service.ts and 4 other locations - About 45 mins to fix
frontend/src/app/core/engines/engines.service.ts on lines 17..19
frontend/src/app/core/meshs/meshs.service.ts on lines 24..26
frontend/src/app/core/user/user.service.ts on lines 28..30
frontend/src/app/core/vulnerabilities/vulnerabilities.service.ts on lines 20..23

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

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

  def generate
    platform = Platform.find_by_name(params[:name])
    unless allowed_platform?(platform)
      return render status: 422, json: { message: I18n.t('errors.controllers.admin.invoices.unsupported_platform') }
    end
Severity: Minor
Found in backend/app/controllers/admin/invoice_controller.rb - About 45 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 15 locations. Consider refactoring.
Open

  updateCloud(data:UpdateCloudProvider): Observable<UpdateProviderResponse> {
    return this.httpService.patch<UpdateProviderResponse>('/admin/providers',data)
  }
Severity: Major
Found in frontend/src/app/core/cloudProvider/cloudProvider.service.ts and 14 other locations - About 40 mins to fix
frontend/src/app/core/bugbountyPlatform/bugbountyPlatform.service.ts on lines 27..29
frontend/src/app/core/bugbountyPlatform/bugbountyPlatform.service.ts on lines 31..33
frontend/src/app/core/cloudProvider/cloudProvider.service.ts on lines 11..13
frontend/src/app/core/engines/engines.service.ts on lines 14..16
frontend/src/app/core/invoices/invoices.service.ts on lines 16..18
frontend/src/app/core/meshs/meshs.service.ts on lines 18..20
frontend/src/app/core/meshs/meshs.service.ts on lines 21..23
frontend/src/app/core/meshs/meshs.service.ts on lines 27..29
frontend/src/app/core/meshs/meshs.service.ts on lines 30..32
frontend/src/app/core/nuclei/nuclei.service.ts on lines 17..19
frontend/src/app/core/scan/scan.service.ts on lines 17..19
frontend/src/app/core/tools/tools.service.ts on lines 20..22
frontend/src/app/core/user/user.service.ts on lines 21..23
frontend/src/app/core/user/user.service.ts on lines 25..27

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

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

  addTemplate(data:NucleiAddTemplate): Observable<NucleiResponse> {
    return this.httpService.post<NucleiResponse>('/nuclei/',data)
  }
Severity: Major
Found in frontend/src/app/core/nuclei/nuclei.service.ts and 14 other locations - About 40 mins to fix
frontend/src/app/core/bugbountyPlatform/bugbountyPlatform.service.ts on lines 27..29
frontend/src/app/core/bugbountyPlatform/bugbountyPlatform.service.ts on lines 31..33
frontend/src/app/core/cloudProvider/cloudProvider.service.ts on lines 11..13
frontend/src/app/core/cloudProvider/cloudProvider.service.ts on lines 17..19
frontend/src/app/core/engines/engines.service.ts on lines 14..16
frontend/src/app/core/invoices/invoices.service.ts on lines 16..18
frontend/src/app/core/meshs/meshs.service.ts on lines 18..20
frontend/src/app/core/meshs/meshs.service.ts on lines 21..23
frontend/src/app/core/meshs/meshs.service.ts on lines 27..29
frontend/src/app/core/meshs/meshs.service.ts on lines 30..32
frontend/src/app/core/scan/scan.service.ts on lines 17..19
frontend/src/app/core/tools/tools.service.ts on lines 20..22
frontend/src/app/core/user/user.service.ts on lines 21..23
frontend/src/app/core/user/user.service.ts on lines 25..27

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

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

  createUser(data:AddUser): Observable<UserResponse> {
    return this.httpService.post<UserResponse>('/admin/users',data)
  }
Severity: Major
Found in frontend/src/app/core/user/user.service.ts and 14 other locations - About 40 mins to fix
frontend/src/app/core/bugbountyPlatform/bugbountyPlatform.service.ts on lines 27..29
frontend/src/app/core/bugbountyPlatform/bugbountyPlatform.service.ts on lines 31..33
frontend/src/app/core/cloudProvider/cloudProvider.service.ts on lines 11..13
frontend/src/app/core/cloudProvider/cloudProvider.service.ts on lines 17..19
frontend/src/app/core/engines/engines.service.ts on lines 14..16
frontend/src/app/core/invoices/invoices.service.ts on lines 16..18
frontend/src/app/core/meshs/meshs.service.ts on lines 18..20
frontend/src/app/core/meshs/meshs.service.ts on lines 21..23
frontend/src/app/core/meshs/meshs.service.ts on lines 27..29
frontend/src/app/core/meshs/meshs.service.ts on lines 30..32
frontend/src/app/core/nuclei/nuclei.service.ts on lines 17..19
frontend/src/app/core/scan/scan.service.ts on lines 17..19
frontend/src/app/core/tools/tools.service.ts on lines 20..22
frontend/src/app/core/user/user.service.ts on lines 21..23

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

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

  createPlatform(data:BugBountyPlatformSettingsUpdate): Observable<BugBountyPlatformSettingsResponse> {
    return this.httpService.post<BugBountyPlatformSettingsResponse>('/admin/platforms',data)
  }
frontend/src/app/core/bugbountyPlatform/bugbountyPlatform.service.ts on lines 27..29
frontend/src/app/core/cloudProvider/cloudProvider.service.ts on lines 11..13
frontend/src/app/core/cloudProvider/cloudProvider.service.ts on lines 17..19
frontend/src/app/core/engines/engines.service.ts on lines 14..16
frontend/src/app/core/invoices/invoices.service.ts on lines 16..18
frontend/src/app/core/meshs/meshs.service.ts on lines 18..20
frontend/src/app/core/meshs/meshs.service.ts on lines 21..23
frontend/src/app/core/meshs/meshs.service.ts on lines 27..29
frontend/src/app/core/meshs/meshs.service.ts on lines 30..32
frontend/src/app/core/nuclei/nuclei.service.ts on lines 17..19
frontend/src/app/core/scan/scan.service.ts on lines 17..19
frontend/src/app/core/tools/tools.service.ts on lines 20..22
frontend/src/app/core/user/user.service.ts on lines 21..23
frontend/src/app/core/user/user.service.ts on lines 25..27

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

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

  addScans(data:AddScan): Observable<ScanResponse> {
    return this.httpService.post<ScanResponse>('/scans',data)
  }
Severity: Major
Found in frontend/src/app/core/scan/scan.service.ts and 14 other locations - About 40 mins to fix
frontend/src/app/core/bugbountyPlatform/bugbountyPlatform.service.ts on lines 27..29
frontend/src/app/core/bugbountyPlatform/bugbountyPlatform.service.ts on lines 31..33
frontend/src/app/core/cloudProvider/cloudProvider.service.ts on lines 11..13
frontend/src/app/core/cloudProvider/cloudProvider.service.ts on lines 17..19
frontend/src/app/core/engines/engines.service.ts on lines 14..16
frontend/src/app/core/invoices/invoices.service.ts on lines 16..18
frontend/src/app/core/meshs/meshs.service.ts on lines 18..20
frontend/src/app/core/meshs/meshs.service.ts on lines 21..23
frontend/src/app/core/meshs/meshs.service.ts on lines 27..29
frontend/src/app/core/meshs/meshs.service.ts on lines 30..32
frontend/src/app/core/nuclei/nuclei.service.ts on lines 17..19
frontend/src/app/core/tools/tools.service.ts on lines 20..22
frontend/src/app/core/user/user.service.ts on lines 21..23
frontend/src/app/core/user/user.service.ts on lines 25..27

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

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