EasyRecon/Hunt3r

View on GitHub

Showing 134 of 138 total issues

Function globalStat has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  globalStat(scope:any,platform:'YWH'|'INTI'|'H1'):any{
    let returnData:{report_by_month:any,earn_by_month:any,report_by_status:any,earnedEuro:number,collab_number:number,rapport_severity:any,average_per_rapport:number,total_rapports:number}={
      "report_by_month":{},
      "earn_by_month":{},
      "report_by_status":{},
Severity: Minor
Found in frontend/src/app/admin/bugbountyStat/bugbountyStat.component.ts - About 1 hr to fix

    Function ngOnInit has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      async ngOnInit() {
        this.screen = window.screen.width
        if(this.screen < 960){
          this.toggleLeft()
        }

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

          this.toolsFormGlobal= this.fbuilder.group({ name: '',user: '', password: '',api_key:'',webhook:'',url:'',config_value:''});
      Severity: Major
      Found in frontend/src/app/admin/tools/tools.component.ts and 1 other location - About 1 hr to fix
      frontend/src/app/admin/tools/tools.component.ts on lines 58..58

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

      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

          this.toolsFormGlobal= this.fbuilder.group({ name: '',user: '', password: '',api_key:'',webhook:'',url:'',config_value:''});
      Severity: Major
      Found in frontend/src/app/admin/tools/tools.component.ts and 1 other location - About 1 hr to fix
      frontend/src/app/admin/tools/tools.component.ts on lines 44..44

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

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

        getPlatform(){
          this.intigriti = {
            "email":"",
            "hunter_username":"",
            "password":"",

        Method provider_is_valid? has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        def provider_is_valid?(providers_params)
          case providers_params[:name]
          when 'scaleway'
            path = '/root/.config/scw/config.yaml'
            dir = File.dirname(path)
        Severity: Minor
        Found in backend/app/controllers/admin/providers_controller.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function addScan has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          addScan(domain:any){
            this.loadingModal=true
            let scanProperties:AddScanData;
            let scanFound=false
            this.enginesList.forEach((element)=>{
        Severity: Minor
        Found in frontend/src/app/pages/scans/scans.component.ts - About 1 hr to fix

          Method create has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def create
              scan_infos = params.require(:scan).permit(
                :domain, :meshs, :type_scan, :instance_type, :provider, :notifs, :active_recon, :intel, :leak, :nuclei,
                :all_templates, :custom_interactsh, :permutation, :gau, excludes: [], nuclei_severity: [], custom_templates: []
              )
          Severity: Minor
          Found in backend/app/controllers/scans_controller.rb - About 1 hr to fix

            Method cost has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def cost
                last_update = if state == 'Finished' || state == 'Stopped'
                                updated_at.to_i
                              else
                                Time.now.to_i
            Severity: Minor
            Found in backend/app/models/scan.rb - About 1 hr to fix

              Method check_tools has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def check_tools(tool)
                  case tool.name
                  when 'amass'
                    value = tool.infos['config_value']
                    return 'amass_invalid' unless base64?(value)
              Severity: Minor
              Found in backend/app/controllers/admin/tools_controller.rb - About 1 hr to fix

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

                  getScope(platform:any): Observable<BugBountyPlatformSyncsData> {
                    return this.httpService.get<BugBountyPlatformSyncsData>('/admin/platforms/'+platform+'/stats')
                  }
                frontend/src/app/core/bugbountyPlatform/bugbountyPlatform.service.ts on lines 39..41

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

                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

                  syncScope(platform:any): Observable<BugBountyPlatformSyncsResponse> {
                    return this.httpService.patch<BugBountyPlatformSyncsResponse>('/admin/platforms/'+platform+'/stats')
                  }
                frontend/src/app/core/bugbountyPlatform/bugbountyPlatform.service.ts on lines 35..37

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

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

                  def index
                    @subdomains = if params[:domain]
                                    domain = Domain.find_by_name(params[:domain])
                                    domain.nil? ? [] : domain.subdomains
                                  else
                Severity: Minor
                Found in backend/app/controllers/subdomains_controller.rb - About 55 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

                  changeLimit(event:any){
                    this.limit=event
                    if(event=='-1')this.page=1
                    this.getDomains()
                  }
                Severity: Major
                Found in frontend/src/app/pages/domains/domains.component.ts and 3 other locations - About 55 mins to fix
                frontend/src/app/pages/subdomains/subdomains.component.ts on lines 90..94
                frontend/src/app/pages/urls/urls.component.ts on lines 49..53
                frontend/src/app/pages/vulnerabilities/vulnerabilities.component.ts on lines 107..111

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

                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

                  changeLimit(event:any){
                    this.limit=event
                    if(event=='-1')this.page=1
                    this.getSubdomains()
                  }
                Severity: Major
                Found in frontend/src/app/pages/subdomains/subdomains.component.ts and 3 other locations - About 55 mins to fix
                frontend/src/app/pages/domains/domains.component.ts on lines 58..62
                frontend/src/app/pages/urls/urls.component.ts on lines 49..53
                frontend/src/app/pages/vulnerabilities/vulnerabilities.component.ts on lines 107..111

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

                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

                   this.dialogueRefCreate= this.dialogService.open(this.dialogCreateGlobal, { context: {name:tool,required:this.toolModel[tool]} });
                Severity: Minor
                Found in frontend/src/app/admin/tools/tools.component.ts and 1 other location - About 55 mins to fix
                frontend/src/app/admin/tools/tools.component.ts on lines 71..71

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

                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

                   this.dialogueRefCreate= this.dialogService.open(this.dialogCreateGlobal, { context: {name:tool,required:this.toolModel[tool]} });
                Severity: Minor
                Found in frontend/src/app/admin/tools/tools.component.ts and 1 other location - About 55 mins to fix
                frontend/src/app/admin/tools/tools.component.ts on lines 66..66

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

                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

                  changeLimit(event:any){
                    this.limit=event
                    if(event=='-1')this.page=1
                    this.getUrls()
                  }
                Severity: Major
                Found in frontend/src/app/pages/urls/urls.component.ts and 3 other locations - About 55 mins to fix
                frontend/src/app/pages/domains/domains.component.ts on lines 58..62
                frontend/src/app/pages/subdomains/subdomains.component.ts on lines 90..94
                frontend/src/app/pages/vulnerabilities/vulnerabilities.component.ts on lines 107..111

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

                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

                  changeLimit(event:any){
                    this.limit=event
                    if(event=='-1')this.page=1
                    this.getVulnerabilities()
                  }
                frontend/src/app/pages/domains/domains.component.ts on lines 58..62
                frontend/src/app/pages/subdomains/subdomains.component.ts on lines 90..94
                frontend/src/app/pages/urls/urls.component.ts on lines 49..53

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

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

                  def self.parse_payouts(payouts, from, to)
                    payouts_data = {}
                
                    payouts.each do |payout|
                      next unless payout['createdAt'] > from && payout['createdAt'] < to
                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

                Severity
                Category
                Status
                Source
                Language