lizard 1.17.16__tar.gz → 1.17.18__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. {lizard-1.17.16 → lizard-1.17.18}/PKG-INFO +1 -1
  2. {lizard-1.17.16 → lizard-1.17.18}/lizard.egg-info/PKG-INFO +1 -1
  3. {lizard-1.17.16 → lizard-1.17.18}/lizard.py +1 -0
  4. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/version.py +1 -1
  5. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/clike.py +8 -0
  6. lizard-1.17.18/lizard_languages/go.py +45 -0
  7. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/java.py +58 -5
  8. lizard-1.17.18/lizard_languages/javascript.py +15 -0
  9. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/jsx.py +17 -3
  10. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/python.py +2 -1
  11. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/ruby.py +3 -2
  12. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/tsx.py +1 -2
  13. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/typescript.py +9 -5
  14. {lizard-1.17.16 → lizard-1.17.18}/test/testOutput.py +9 -0
  15. lizard-1.17.16/lizard_languages/go.py +0 -22
  16. lizard-1.17.16/lizard_languages/javascript.py +0 -19
  17. {lizard-1.17.16 → lizard-1.17.18}/LICENSE.txt +0 -0
  18. {lizard-1.17.16 → lizard-1.17.18}/README.rst +0 -0
  19. {lizard-1.17.16 → lizard-1.17.18}/lizard.egg-info/SOURCES.txt +0 -0
  20. {lizard-1.17.16 → lizard-1.17.18}/lizard.egg-info/dependency_links.txt +0 -0
  21. {lizard-1.17.16 → lizard-1.17.18}/lizard.egg-info/entry_points.txt +0 -0
  22. {lizard-1.17.16 → lizard-1.17.18}/lizard.egg-info/requires.txt +0 -0
  23. {lizard-1.17.16 → lizard-1.17.18}/lizard.egg-info/top_level.txt +0 -0
  24. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/__init__.py +0 -0
  25. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/auto_open.py +0 -0
  26. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/csvoutput.py +0 -0
  27. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/default_ordered_dict.py +0 -0
  28. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/extension_base.py +0 -0
  29. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/htmloutput.py +0 -0
  30. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/keywords.py +0 -0
  31. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardboolcount.py +0 -0
  32. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardcomplextags.py +0 -0
  33. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardcpre.py +0 -0
  34. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizarddependencycount.py +0 -0
  35. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizarddumpcomments.py +0 -0
  36. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardduplicate.py +0 -0
  37. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardduplicated_param_list.py +0 -0
  38. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardexitcount.py +0 -0
  39. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardgotocount.py +0 -0
  40. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardignoreassert.py +0 -0
  41. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardio.py +0 -0
  42. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardmccabe.py +0 -0
  43. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardmodified.py +0 -0
  44. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardnd.py +0 -0
  45. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardnonstrict.py +0 -0
  46. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardns.py +0 -0
  47. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardoutside.py +0 -0
  48. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardstatementcount.py +0 -0
  49. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/lizardwordcount.py +0 -0
  50. {lizard-1.17.16 → lizard-1.17.18}/lizard_ext/xmloutput.py +0 -0
  51. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/__init__.py +0 -0
  52. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/code_reader.py +0 -0
  53. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/csharp.py +0 -0
  54. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/erlang.py +0 -0
  55. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/fortran.py +0 -0
  56. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/gdscript.py +0 -0
  57. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/golike.py +0 -0
  58. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/js_style_language_states.py +0 -0
  59. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/js_style_regex_expression.py +0 -0
  60. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/kotlin.py +0 -0
  61. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/lua.py +0 -0
  62. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/objc.py +0 -0
  63. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/php.py +0 -0
  64. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/rubylike.py +0 -0
  65. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/rust.py +0 -0
  66. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/scala.py +0 -0
  67. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/script_language.py +0 -0
  68. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/solidity.py +0 -0
  69. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/swift.py +0 -0
  70. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/tnsdl.py +0 -0
  71. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/ttcn.py +0 -0
  72. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/vue.py +0 -0
  73. {lizard-1.17.16 → lizard-1.17.18}/lizard_languages/zig.py +0 -0
  74. {lizard-1.17.16 → lizard-1.17.18}/setup.cfg +0 -0
  75. {lizard-1.17.16 → lizard-1.17.18}/setup.py +0 -0
  76. {lizard-1.17.16 → lizard-1.17.18}/test/testApplication.py +0 -0
  77. {lizard-1.17.16 → lizard-1.17.18}/test/testAssertionExtension.py +0 -0
  78. {lizard-1.17.16 → lizard-1.17.18}/test/testBasicFunctionInfo.py +0 -0
  79. {lizard-1.17.16 → lizard-1.17.18}/test/testCOutsideComplexity.py +0 -0
  80. {lizard-1.17.16 → lizard-1.17.18}/test/testCPreprocessorExtension.py +0 -0
  81. {lizard-1.17.16 → lizard-1.17.18}/test/testCommentOptions.py +0 -0
  82. {lizard-1.17.16 → lizard-1.17.18}/test/testCyclomaticComplexity.py +0 -0
  83. {lizard-1.17.16 → lizard-1.17.18}/test/testExtension.py +0 -0
  84. {lizard-1.17.16 → lizard-1.17.18}/test/testFilesFilter.py +0 -0
  85. {lizard-1.17.16 → lizard-1.17.18}/test/testFunctionDependencyCount.py +0 -0
  86. {lizard-1.17.16 → lizard-1.17.18}/test/testFunctionExitCount.py +0 -0
  87. {lizard-1.17.16 → lizard-1.17.18}/test/testFunctionGotoCount.py +0 -0
  88. {lizard-1.17.16 → lizard-1.17.18}/test/testFunctionStatementCount.py +0 -0
  89. {lizard-1.17.16 → lizard-1.17.18}/test/testHelpers.py +0 -0
  90. {lizard-1.17.16 → lizard-1.17.18}/test/testLanguages.py +0 -0
  91. {lizard-1.17.16 → lizard-1.17.18}/test/testMcCabe.py +0 -0
  92. {lizard-1.17.16 → lizard-1.17.18}/test/testNestedStructures.py +0 -0
  93. {lizard-1.17.16 → lizard-1.17.18}/test/testNestingDepth.py +0 -0
  94. {lizard-1.17.16 → lizard-1.17.18}/test/testOutputCSV.py +0 -0
  95. {lizard-1.17.16 → lizard-1.17.18}/test/testOutputFile.py +0 -0
  96. {lizard-1.17.16 → lizard-1.17.18}/test/testOutputHTML.py +0 -0
  97. {lizard-1.17.16 → lizard-1.17.18}/test/testTokenizer.py +0 -0
  98. {lizard-1.17.16 → lizard-1.17.18}/test/test_analyzer.py +0 -0
  99. {lizard-1.17.16 → lizard-1.17.18}/test/test_auto_open.py +0 -0
  100. {lizard-1.17.16 → lizard-1.17.18}/test/test_options.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lizard
3
- Version: 1.17.16
3
+ Version: 1.17.18
4
4
  Summary: A code analyzer without caring the C/C++ header files. It works with Java, C/C++, JavaScript, Python, Ruby, Swift, Objective C. Metrics includes cyclomatic complexity number etc.
5
5
  Home-page: http://www.lizard.ws
6
6
  Download-URL: https://pypi.python.org/lizard/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lizard
3
- Version: 1.17.16
3
+ Version: 1.17.18
4
4
  Summary: A code analyzer without caring the C/C++ header files. It works with Java, C/C++, JavaScript, Python, Ruby, Swift, Objective C. Metrics includes cyclomatic complexity number etc.
5
5
  Home-page: http://www.lizard.ws
6
6
  Download-URL: https://pypi.python.org/lizard/
@@ -284,6 +284,7 @@ class FunctionInfo(Nesting): # pylint: disable=R0902
284
284
  self.fan_in = 0
285
285
  self.fan_out = 0
286
286
  self.general_fan_out = 0
287
+ self.max_nesting_depth = 0 # Initialize max_nesting_depth to 0
287
288
 
288
289
  @property
289
290
  def name_in_space(self):
@@ -3,4 +3,4 @@
3
3
  #
4
4
  # pylint: disable=missing-docstring,invalid-name
5
5
 
6
- version = "1.17.16"
6
+ version = "1.17.18"
@@ -30,6 +30,14 @@ class CLikeReader(CodeReader, CCppCommentsMixin):
30
30
  CLikeNestingStackStates(context),
31
31
  CppRValueRefStates(context))
32
32
 
33
+ @staticmethod
34
+ def generate_tokens(source_code, addition='', token_class=None):
35
+ # Add pattern for floating point literals to the token generation
36
+ addition = r"|(?:\d*\.\d+(?:[eE][-+]?\d+)?)" + \
37
+ r"|(?:\d+\.(?:\d+)?(?:[eE][-+]?\d+)?)" + \
38
+ addition
39
+ return CodeReader.generate_tokens(source_code, addition, token_class)
40
+
33
41
  def preprocess(self, tokens):
34
42
  tilde = False
35
43
  for token in tokens:
@@ -0,0 +1,45 @@
1
+ '''
2
+ Language parser for Go lang
3
+ '''
4
+
5
+ from .code_reader import CodeReader
6
+ from .clike import CCppCommentsMixin
7
+ from .golike import GoLikeStates
8
+
9
+
10
+ class GoReader(CodeReader, CCppCommentsMixin):
11
+ # pylint: disable=R0903
12
+
13
+ ext = ['go']
14
+ language_names = ['go']
15
+
16
+ def __init__(self, context):
17
+ super(GoReader, self).__init__(context)
18
+ self.parallel_states = [GoStates(context)]
19
+
20
+ @staticmethod
21
+ def generate_tokens(source_code, addition='', token_class=None):
22
+ addition = addition + r"|`[^`]*`" # Add support for backtick-quoted strings
23
+ return CodeReader.generate_tokens(source_code, addition, token_class)
24
+
25
+ def __call__(self, tokens, reader):
26
+ self.context = reader.context
27
+ for token in tokens:
28
+ # Skip counting ? in backtick-quoted strings
29
+ if token.startswith('`') and token.endswith('`'):
30
+ for state in self.parallel_states:
31
+ state(token)
32
+ yield token
33
+ continue
34
+
35
+ # For non-backtick tokens, process normally
36
+ for state in self.parallel_states:
37
+ state(token)
38
+ yield token
39
+ for state in self.parallel_states:
40
+ state.statemachine_before_return()
41
+ self.eof()
42
+
43
+
44
+ class GoStates(GoLikeStates): # pylint: disable=R0903
45
+ pass
@@ -2,6 +2,7 @@
2
2
  Language parser for Java
3
3
  '''
4
4
 
5
+ from lizard_languages.code_reader import CodeStateMachine
5
6
  from .clike import CLikeReader, CLikeStates, CLikeNestingStackStates
6
7
 
7
8
 
@@ -29,6 +30,11 @@ class JavaStates(CLikeStates): # pylint: disable=R0903
29
30
  if token == '{':
30
31
  self._state_dec_to_imp(token)
31
32
 
33
+ def _state_imp(self, token):
34
+ def callback():
35
+ self.next(self._state_global)
36
+ self.sub_state(JavaFunctionBodyStates(self.context), callback, token)
37
+
32
38
  def try_new_function(self, name):
33
39
  # Don't create a function for record compact constructor
34
40
  if self.is_record and name == self.class_name:
@@ -40,15 +46,19 @@ class JavaStates(CLikeStates): # pylint: disable=R0903
40
46
  if self.class_name and self.context.current_function:
41
47
  self.context.current_function.name = f"{self.class_name}::{name}"
42
48
 
43
- def _state_global(self, token):
44
- if token == '@':
45
- self._state = self._state_decorator
46
- return
49
+ def _try_start_a_class(self, token):
47
50
  if token in ("class", "record", "enum"):
48
51
  self.class_name = None
49
52
  self.is_record = token == "record"
50
53
  self.in_record_constructor = False
51
54
  self._state = self._state_class_declaration
55
+ return True
56
+
57
+ def _state_global(self, token):
58
+ if token == '@':
59
+ self._state = self._state_decorator
60
+ return
61
+ if self._try_start_a_class(token):
52
62
  return
53
63
  if not self.in_record_constructor: # Only process as potential function if not in record constructor
54
64
  super(JavaStates, self)._state_global(token)
@@ -65,7 +75,9 @@ class JavaStates(CLikeStates): # pylint: disable=R0903
65
75
 
66
76
  def _state_class_declaration(self, token):
67
77
  if token == '{':
68
- self._state = self._state_global
78
+ def callback():
79
+ self._state = self._state_global
80
+ self.sub_state(JavaClassBodyStates(self.class_name, self.is_record, self.context), callback, token)
69
81
  elif token == '(': # Record parameters
70
82
  self._state = self._state_record_parameters
71
83
  elif token[0].isalpha():
@@ -87,3 +99,44 @@ class JavaStates(CLikeStates): # pylint: disable=R0903
87
99
  if token == '}':
88
100
  self.in_record_constructor = False
89
101
  self._state = self._state_global
102
+
103
+ class JavaFunctionBodyStates(JavaStates):
104
+ def __init__(self, context):
105
+ super(JavaFunctionBodyStates, self).__init__(context)
106
+
107
+ @CodeStateMachine.read_inside_brackets_then("{}", "_state_dummy")
108
+ @CodeStateMachine.read_inside_brackets_then("()", "_state_dummy")
109
+ def _state_global(self, token):
110
+ if token == "new":
111
+ self.next(self._state_new)
112
+ self._try_start_a_class(token)
113
+ if self.br_count == 0:
114
+ self.statemachine_return()
115
+
116
+ def _state_dummy(self, _):
117
+ pass
118
+
119
+ def _state_new(self, token):
120
+ self.next(self._state_new_parameters)
121
+
122
+ def _state_new_parameters(self, token):
123
+ if token == "(":
124
+ self.sub_state(JavaFunctionBodyStates(self.context), None, token)
125
+ return
126
+ if token == "{":
127
+ def callback():
128
+ self.next(self._state_global)
129
+ self.sub_state(JavaClassBodyStates("(anonymous)", False, self.context), callback, token)
130
+ return
131
+ self.next(self._state_global)
132
+
133
+ class JavaClassBodyStates(JavaStates):
134
+ def __init__(self, class_name, is_record, context):
135
+ super(JavaClassBodyStates, self).__init__(context)
136
+ self.class_name = class_name
137
+ self.is_record = is_record
138
+
139
+ def _state_global(self, token):
140
+ super()._state_global(token)
141
+ if token == '}':
142
+ self.statemachine_return()
@@ -0,0 +1,15 @@
1
+ '''
2
+ Language parser for JavaScript
3
+ '''
4
+
5
+ from .typescript import TypeScriptReader
6
+
7
+
8
+ class JavaScriptReader(TypeScriptReader):
9
+ # pylint: disable=R0903
10
+
11
+ ext = ['js', 'cjs', 'mjs']
12
+ language_names = ['javascript', 'js']
13
+
14
+ def __init__(self, context):
15
+ super(JavaScriptReader, self).__init__(context)
@@ -8,6 +8,20 @@ from .code_reader import CodeReader
8
8
  from .js_style_regex_expression import js_style_regex_expression
9
9
 
10
10
 
11
+ class TSXTokenizer(JSTokenizer):
12
+ def __init__(self):
13
+ super().__init__()
14
+
15
+ def process_token(self, token):
16
+ if token == "<":
17
+ from .jsx import XMLTagWithAttrTokenizer # Import only when needed
18
+ self.sub_tokenizer = XMLTagWithAttrTokenizer()
19
+ return
20
+
21
+ for tok in super().process_token(token):
22
+ yield tok
23
+
24
+
11
25
  class JSXMixin:
12
26
  '''Base mixin class for JSX/TSX shared functionality'''
13
27
  @staticmethod
@@ -17,7 +31,7 @@ class JSXMixin:
17
31
  r"|(?:\$\w+)" + \
18
32
  r"|(?:\<\/\w+\>)" + \
19
33
  r"|`.*?`"
20
- js_tokenizer = JSTokenizer()
34
+ js_tokenizer = TSXTokenizer()
21
35
  for token in CodeReader.generate_tokens(
22
36
  source_code, addition, token_class):
23
37
  for tok in js_tokenizer(token):
@@ -102,7 +116,7 @@ class XMLTagWithAttrTokenizer(Tokenizer):
102
116
  self.state = self._after_tag
103
117
  elif token == "{":
104
118
  self.cache.append("}")
105
- self.sub_tokenizer = JSTokenizer()
119
+ self.sub_tokenizer = TSXTokenizer()
106
120
  self.state = self._after_tag
107
121
 
108
122
  def _body(self, token):
@@ -116,7 +130,7 @@ class XMLTagWithAttrTokenizer(Tokenizer):
116
130
  return self.flush()
117
131
 
118
132
  if token == '{':
119
- self.sub_tokenizer = JSTokenizer()
133
+ self.sub_tokenizer = TSXTokenizer()
120
134
  return self.flush()
121
135
 
122
136
 
@@ -42,7 +42,8 @@ class PythonReader(CodeReader, ScriptLanguageMixIn):
42
42
  def generate_tokens(source_code, addition='', token_class=None):
43
43
  return ScriptLanguageMixIn.generate_common_tokens(
44
44
  source_code,
45
- r"|\'\'\'.*?\'\'\'" + r'|\"\"\".*?\"\"\"',
45
+ r"|(?:\"\"\"(?:\\.|[^\"]|\"(?!\"\")|\"\"(?!\"))*\"\"\")" +
46
+ r"|(?:\'\'\'(?:\\.|[^\']|\'(?!\'\')|\'\'(?!\'))*\'\'\')",
46
47
  token_class)
47
48
 
48
49
  def preprocess(self, tokens):
@@ -9,11 +9,12 @@ from .script_language import ScriptLanguageMixIn
9
9
 
10
10
  class MyToken(str):
11
11
  def __new__(cls, value, *_):
12
- return super(MyToken, cls).__new__(cls, value.group(0))
12
+ val = value.group(0) if hasattr(value, 'group') else value
13
+ return super(MyToken, cls).__new__(cls, val)
13
14
 
14
15
  def __init__(self, value):
15
16
  super(MyToken, self).__init__()
16
- self.begin = value.start()
17
+ self.begin = value.start() if hasattr(value, 'start') else 0
17
18
 
18
19
 
19
20
  class RubyReader(RubylikeReader):
@@ -2,9 +2,8 @@
2
2
  Language parser for TSX
3
3
  '''
4
4
 
5
- from .typescript import TypeScriptReader, TypeScriptStates, JSTokenizer
5
+ from .typescript import TypeScriptReader
6
6
  from .jsx import JSXMixin
7
- from .code_reader import CodeReader
8
7
  from .js_style_regex_expression import js_style_regex_expression
9
8
 
10
9
 
@@ -37,10 +37,6 @@ class JSTokenizer(Tokenizer):
37
37
  self.depth = 1
38
38
 
39
39
  def process_token(self, token):
40
- if token == "<":
41
- from .jsx import XMLTagWithAttrTokenizer # Import only when needed
42
- self.sub_tokenizer = XMLTagWithAttrTokenizer()
43
- return
44
40
  if token == "{":
45
41
  self.depth += 1
46
42
  elif token == "}":
@@ -115,10 +111,18 @@ class TypeScriptTypeAnnotationStates(CodeStateMachine):
115
111
  self.next(self._state_simple_type, token)
116
112
 
117
113
  def _state_simple_type(self, token):
118
- if token in '{=;':
114
+ print(token)
115
+ if token == '<':
116
+ print(token)
117
+ self.next(self._state_generic_type, token)
118
+ elif token in '{=;':
119
119
  self.saved_token = token
120
120
  self.statemachine_return()
121
121
 
122
122
  @CodeStateMachine.read_inside_brackets_then("{}")
123
123
  def _inline_type_annotation(self, _):
124
124
  self.statemachine_return()
125
+
126
+ @CodeStateMachine.read_inside_brackets_then("<>")
127
+ def _state_generic_type(self, token):
128
+ self.statemachine_return()
@@ -86,6 +86,15 @@ class TestWarningOutput(StreamStdoutTestCase):
86
86
  self.option.sorting = ['cyclomatic_complexity']
87
87
  print_warnings(self.option, self.scheme, (x for x in []))
88
88
 
89
+ def test_warning_when_max_nesting_depth_missing(self):
90
+ self.foo.cyclomatic_complexity = 30
91
+ # Intentionally not setting max_nesting_depth
92
+ fileSummary = FileInformation("FILENAME", 123, [self.foo])
93
+ scheme = OutputScheme([Ext()])
94
+ count = print_clang_style_warning([fileSummary], self.option, scheme, None)
95
+ self.assertIn("FILENAME:100: warning: foo has 1 NLOC, 30 CCN, 1 token, 0 PARAM, 1 length", sys.stdout.stream)
96
+ self.assertEqual(1, count)
97
+
89
98
 
90
99
  class TestFileInformationOutput(StreamStdoutTestCase):
91
100
 
@@ -1,22 +0,0 @@
1
- '''
2
- Language parser for Go lang
3
- '''
4
-
5
- from .code_reader import CodeReader
6
- from .clike import CCppCommentsMixin
7
- from .golike import GoLikeStates
8
-
9
-
10
- class GoReader(CodeReader, CCppCommentsMixin):
11
- # pylint: disable=R0903
12
-
13
- ext = ['go']
14
- language_names = ['go']
15
-
16
- def __init__(self, context):
17
- super(GoReader, self).__init__(context)
18
- self.parallel_states = [GoStates(context)]
19
-
20
-
21
- class GoStates(GoLikeStates): # pylint: disable=R0903
22
- pass
@@ -1,19 +0,0 @@
1
- '''
2
- Language parser for JavaScript
3
- '''
4
-
5
- from .code_reader import CodeReader
6
- from .clike import CCppCommentsMixin
7
- from .js_style_regex_expression import js_style_regex_expression
8
- from .js_style_language_states import JavaScriptStyleLanguageStates
9
- from .typescript import TypeScriptReader, JSTokenizer
10
-
11
-
12
- class JavaScriptReader(TypeScriptReader):
13
- # pylint: disable=R0903
14
-
15
- ext = ['js']
16
- language_names = ['javascript', 'js']
17
-
18
- def __init__(self, context):
19
- super(JavaScriptReader, self).__init__(context)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes