Siirry sisältöön
Softagram
  • Etusivu
  • Palvelut
    • Toiminnanohjaus
    • Tekoälypalvelut
    • Tietoturvapalvelut
  • Yritys
  • Ota yhteyttä
  • Uutiset ja oppaat
    • Uutiset
    • Oppaat
  • Tech
  • Kirjaudu sisään
  • Ota yhteyttä
Softagram
      • Etusivu
      • Palvelut
        • Toiminnanohjaus
        • Tekoälypalvelut
        • Tietoturvapalvelut
      • Yritys
      • Ota yhteyttä
      • Uutiset ja oppaat
        • Uutiset
        • Oppaat
      • Tech
    • Kirjaudu sisään
    • Ota yhteyttä

    Copy paste detector alias finding duplicate code

    Reference
  • Kaikki blogit
  • Oppaat
  • Copy paste detector alias finding duplicate code
  • 15. heinäkuuta 2021 kirjoittanut
    Copy paste detector alias finding duplicate code
    Ville Laitila

    Detecting duplicated code before you merge the code could save you 10x time instead of fixing it later. Now Softagram detects new and existing copy-paste chunks and informs the locations in the code-review phase in our "Impact Report".

    The report could show you e.g. following (example from GitHub discussion flow):
    ​

    Report will show the file or location where the duplicated code is seen, and the beginning of the code including the amount of characters not presented.

    Note: Softagram Impact report will show the duplicate code found only for the files that are modified in that specific Pull/Merge Request (Or Code Review/Patch set).

    Technical details

    Softagram looks for copy paste fragments with minimum tokens approach that acts on tokens instead of exact source code text. This helps detecting duplicate code despite of whitespace differences.

    Hints for Softagram tool admins for on-premise customers:

    Default value for minimum tokens count in duplicate fragment is set to 50, which can be changed with a project level setting analysis.duplicates.min_tokens_in_dupe_fragment
    ​
    Duplicates may exist in the same file or in multiple files. Because the duplicate seeking takes time 5-30 MLOC/h, and the speed decreases when code gets bigger, it is wise to consider disabling the feature for the huge projects with > 5 MLOC, and make several smaller projects for the independent repositories to ensure fast analysis.

    This project level key value pair can be used for disabling it: feature.customization.disabled=duplicates

    Limitations

    TypeScript code (*.tsx, *.ts) is not yet supported by copy paste detector.

    Originally published at help.softagram.com

    in Oppaat
    # Softagram Analyzer

    Älyä toiminnanohjaukseen

    Olemme intohimoinen tiimi, jonka tavoitteena on parantaa kaikkien elämää mullistavien tuotteiden avulla. Kehitämme loistavia tuotteita liiketoimintasi ongelmien ratkaisemiseksi. Tuotteemme on suunniteltu pienille ja keskisuurille yrityksille, jotka haluavat optimoida suorituskykynsä.

    Ota yhteyttä

    Softagram Oy
    Ketolanperäntie 469 
    90450 ​Kempele 

    • +358504836173
    • info@softagram.com
    Seuraa meitä
    Copyright © Softagram Oy
    Järjestelmää pyörittää Odoo - Luo ilmainen verkkosivu