cqfn / aibolit

Static Analyzer for Java Code with Machine Learning in Mind
https://pypi.org/project/aibolit/
51 stars 17 forks source link

Fix issue with SupressWarnings #586

Closed lyriccoder closed 4 years ago

lyriccoder commented 4 years ago

fix https://github.com/cqfn/aibolit/issues/585

acheshkov commented 4 years ago

@rultor merge

rultor commented 4 years ago

@rultor merge

@acheshkov OK, I'll try to merge now. You can check the progress of the merge here

rultor commented 4 years ago

@rultor merge

@acheshkov @lyriccoder Oops, I failed. You can see the full log here (spent 5min)

/home/r/repo/aibolit/ast_framework/java_class_method.py:46: DeprecationWarning: Call to deprecated method children_with_type. (Use ASTNode functionality instead.)
  method_name = next(self.children_with_type(self.root, ASTNodeType.STRING))
/home/r/repo/aibolit/metrics/cognitiveC/cognitive_c.py:131: DeprecationWarning: Call to deprecated method children_with_type. (Use ASTNode functionality instead.)
  names = ast.children_with_type(node, ASTNodeType.STRING)
/home/r/repo/aibolit/metrics/cognitiveC/cognitive_c.py:133: DeprecationWarning: Call to deprecated method get_attr. (Use ASTNode functionality instead.)
  method_name = ast.get_attr(each_string, 'string')
/home/r/repo/aibolit/metrics/cognitiveC/cognitive_c.py:109: DeprecationWarning: Call to deprecated method get_type. (Use ASTNode functionality instead.)
  each_block_type = ast.get_type(each_block)
/home/r/repo/aibolit/ast_framework/ast.py:178: DeprecationWarning: Call to deprecated method get_attr. (Use ASTNode functionality instead.)
  return self.get_attr(node, 'node_type')
/home/r/repo/aibolit/metrics/cognitiveC/cognitive_c.py:91: DeprecationWarning: Call to deprecated method get_type. (Use ASTNode functionality instead.)
  each_block_type = ast.get_type(each_block)
/home/r/repo/aibolit/metrics/cognitiveC/cognitive_c.py:76: DeprecationWarning: Call to deprecated method get_type. (Use ASTNode functionality instead.)
  assert(ast.get_type(node) == ASTNodeType.METHOD_INVOCATION)
/home/r/repo/aibolit/metrics/cognitiveC/cognitive_c.py:93: DeprecationWarning: Call to deprecated method get_binary_operation_name. (Use ASTNode functionality instead.)
  bin_operator = ast.get_binary_operation_name(each_block)
/home/r/repo/aibolit/ast_framework/ast.py:149: DeprecationWarning: Call to deprecated method get_type. (Use ASTNode functionality instead.)
  assert(self.get_type(node) == ASTNodeType.BINARY_OPERATION)
/home/r/repo/aibolit/ast_framework/ast.py:150: DeprecationWarning: Call to deprecated method children_with_type. (Use ASTNode functionality instead.)
  name_node, = islice(self.children_with_type(node, ASTNodeType.STRING), 1)
/home/r/repo/aibolit/ast_framework/ast.py:151: DeprecationWarning: Call to deprecated method get_attr. (Use ASTNode functionality instead.)
  return self.get_attr(name_node, 'string')
./home/r/repo/aibolit/metrics/cognitiveC/cognitive_c.py:49: DeprecationWarning: Call to deprecated method get_type. (Use ASTNode functionality instead.)
  if ast.get_type(all_childs[2]) == ASTNodeType.IF_STATEMENT:
.../home/r/repo/aibolit/metrics/cognitiveC/cognitive_c.py:64: DeprecationWarning: Call to deprecated method get_type. (Use ASTNode functionality instead.)
  if ast.get_type(binary_operation_node) != ASTNodeType.BINARY_OPERATION:
/home/r/repo/aibolit/metrics/cognitiveC/cognitive_c.py:67: DeprecationWarning: Call to deprecated method get_binary_operation_params. (Use ASTNode functionality instead.)
  operator, left_side_node, right_side_node = ast.get_binary_operation_params(binary_operation_node)
/home/r/repo/aibolit/ast_framework/ast.py:214: DeprecationWarning: Call to deprecated method get_type. (Use ASTNode functionality instead.)
  assert(self.get_type(binary_operation_node) == ASTNodeType.BINARY_OPERATION)
/home/r/repo/aibolit/ast_framework/ast.py:216: DeprecationWarning: Call to deprecated method get_attr. (Use ASTNode functionality instead.)
  return BinaryOperationParams(self.get_attr(operation_node, 'string'), left_side_node, right_side_node)
..............sss..................sss................................sssssss......................................................................sssssssssssssss.............................sssssssssssss...........ss.............................................................................................................................FF...........Number of features:  33
...ss.../home/r/repo/test/utils/test_cfg_builder.py:32: DeprecationWarning: Call to deprecated class JavaPackage. (This functionality must be transmitted to ASTNode)
  java_package = JavaPackage(Path(__file__).parent.absolute() / 'SimpleClass.java')
..ssssssssssss
======================================================================
FAIL: test_find_start_end_line_return_by_one_line (test.recommend.test_recommend_pipeline.TestRecommendPipeline)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/r/repo/test/recommend/test_recommend_pipeline.py", line 259, in test_find_start_end_line_return_by_one_line
    self.assertEqual(start, 103)
AssertionError: 108 != 103

======================================================================
FAIL: test_find_start_end_line_return_qqe (test.recommend.test_recommend_pipeline.TestRecommendPipeline)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/r/repo/test/recommend/test_recommend_pipeline.py", line 268, in test_find_start_end_line_return_qqe
    self.assertEqual(start, 103)
AssertionError: 108 != 103

----------------------------------------------------------------------
Ran 391 tests in 21.774s

FAILED (failures=2, skipped=57)
Makefile:15: recipe for target 'unittest' failed
make: *** [unittest] Error 1
container 2dc5f2a4181c346115d8cf17ca47c1bacad9d171e6d94e326762a65c4f5ce92d is dead
Mon Aug  3 15:34:03 CEST 2020
acheshkov commented 4 years ago

@rultor merge

rultor commented 4 years ago

@rultor merge

@acheshkov OK, I'll try to merge now. You can check the progress of the merge here

rultor commented 4 years ago

@rultor merge

@acheshkov Done! FYI, the full log is here (took me 31min)

acheshkov commented 4 years ago

@rultor release, tag=1.2.6rc1

rultor commented 4 years ago

@rultor release, tag=1.2.6rc1

@acheshkov OK, I will release it now. Please check the progress here

rultor commented 4 years ago

@rultor release, tag=1.2.6rc1

@acheshkov Done! FYI, the full log is here (took me 29min)