MCPcopy Create free account
hub / github.com/alibaba/GraphScope / __init__

Method __init__

analytical_engine/misc/cpplint.py:2759–2787  ·  view source on GitHub ↗
(self, name, class_or_struct, clean_lines, linenum)

Source from the content-addressed store, hash-verified

2757 """Stores information about a class."""
2758
2759 def __init__(self, name, class_or_struct, clean_lines, linenum):
2760 _BlockInfo.__init__(self, linenum, False)
2761 self.name = name
2762 self.is_derived = False
2763 self.check_namespace_indentation = True
2764 if class_or_struct == 'struct':
2765 self.access = 'public'
2766 self.is_struct = True
2767 else:
2768 self.access = 'private'
2769 self.is_struct = False
2770
2771 # Remember initial indentation level for this class. Using raw_lines here
2772 # instead of elided to account for leading comments.
2773 self.class_indent = GetIndentLevel(clean_lines.raw_lines[linenum])
2774
2775 # Try to find the end of the class. This will be confused by things like:
2776 # class A {
2777 # } *x = { ...
2778 #
2779 # But it's still good enough for CheckSectionSpacing.
2780 self.last_line = 0
2781 depth = 0
2782 for i in range(linenum, clean_lines.NumLines()):
2783 line = clean_lines.elided[i]
2784 depth += line.count('{') - line.count('}')
2785 if not depth:
2786 self.last_line = i
2787 break
2788
2789 def CheckBegin(self, filename, clean_lines, linenum, error):
2790 # Look for a bare ':'

Callers

nothing calls this directly

Calls 4

GetIndentLevelFunction · 0.85
NumLinesMethod · 0.80
countMethod · 0.65
__init__Method · 0.45

Tested by

no test coverage detected