diff options
Diffstat (limited to 'server/sonar-web/src/main/js/components/SourceViewer/helpers/duplications.ts')
-rw-r--r-- | server/sonar-web/src/main/js/components/SourceViewer/helpers/duplications.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/helpers/duplications.ts b/server/sonar-web/src/main/js/components/SourceViewer/helpers/duplications.ts index ed1d94b6909..9f6eaed3a32 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/helpers/duplications.ts +++ b/server/sonar-web/src/main/js/components/SourceViewer/helpers/duplications.ts @@ -17,8 +17,11 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +import { Duplication, DuplicationBlock } from '../../../types/types'; + // TODO Test this function, but I don't get the logic behind it -export function filterDuplicationBlocksByLine(blocks: T.DuplicationBlock[], line: number) { +export function filterDuplicationBlocksByLine(blocks: DuplicationBlock[], line: number) { /* eslint-disable no-underscore-dangle */ let foundOne = false; return blocks.filter(b => { @@ -36,12 +39,12 @@ export function filterDuplicationBlocksByLine(blocks: T.DuplicationBlock[], line } export function getDuplicationBlocksForIndex( - duplications: T.Duplication[] | undefined, + duplications: Duplication[] | undefined, index: number ) { return (duplications && duplications[index] && duplications[index].blocks) || []; } -export function isDuplicationBlockInRemovedComponent(blocks: T.DuplicationBlock[]) { +export function isDuplicationBlockInRemovedComponent(blocks: DuplicationBlock[]) { return blocks.some(b => b._ref === undefined); // eslint-disable-line no-underscore-dangle } |