Code Duplication    Length = 26-26 lines in 2 locations

sdk/build-support/cpplint.py 1 location

@@ 1355-1380 (lines=26) @@
1352
    return _IsSourceExtension(self.Extension()[1:])
1353
1354
1355
def _ShouldPrintError(category, confidence, linenum):
1356
  """If confidence >= verbose, category passes filter and is not suppressed."""
1357
1358
  # There are three ways we might decide not to print an error message:
1359
  # a "NOLINT(category)" comment appears in the source,
1360
  # the verbosity level isn't high enough, or the filters filter it out.
1361
  if IsErrorSuppressedByNolint(category, linenum):
1362
    return False
1363
1364
  if confidence < _cpplint_state.verbose_level:
1365
    return False
1366
1367
  is_filtered = False
1368
  for one_filter in _Filters():
1369
    if one_filter.startswith('-'):
1370
      if category.startswith(one_filter[1:]):
1371
        is_filtered = True
1372
    elif one_filter.startswith('+'):
1373
      if category.startswith(one_filter[1:]):
1374
        is_filtered = False
1375
    else:
1376
      assert False  # should have been checked for in SetFilter.
1377
  if is_filtered:
1378
    return False
1379
1380
  return True
1381
1382
1383
def Error(filename, linenum, category, confidence, message):

core/build-support/cpplint.py 1 location

@@ 1355-1380 (lines=26) @@
1352
    return _IsSourceExtension(self.Extension()[1:])
1353
1354
1355
def _ShouldPrintError(category, confidence, linenum):
1356
  """If confidence >= verbose, category passes filter and is not suppressed."""
1357
1358
  # There are three ways we might decide not to print an error message:
1359
  # a "NOLINT(category)" comment appears in the source,
1360
  # the verbosity level isn't high enough, or the filters filter it out.
1361
  if IsErrorSuppressedByNolint(category, linenum):
1362
    return False
1363
1364
  if confidence < _cpplint_state.verbose_level:
1365
    return False
1366
1367
  is_filtered = False
1368
  for one_filter in _Filters():
1369
    if one_filter.startswith('-'):
1370
      if category.startswith(one_filter[1:]):
1371
        is_filtered = True
1372
    elif one_filter.startswith('+'):
1373
      if category.startswith(one_filter[1:]):
1374
        is_filtered = False
1375
    else:
1376
      assert False  # should have been checked for in SetFilter.
1377
  if is_filtered:
1378
    return False
1379
1380
  return True
1381
1382
1383
def Error(filename, linenum, category, confidence, message):