You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public void result() {
StringWriter output = new StringWriter();
PythonInterpreter pyInterp = new PythonInterpreter();
pyInterp.setOut(output);
pyInterp.exec("import sys");
pyInterp.exec("sys.path.append('/Users/abcd/Desktop/lizard_code/lizard-1.17.10/')");
pyInterp.exec("import lizard");
pyInterp.exec("i = lizard.analyze_file("/Users/abcd/Desktop/lizardcdb_code/test.java")");
pyInterp.exec("s = i.dict.getitem("function_list")");
PyObject x = pyInterp.get("s");
System.out.println(x.getitem(0).getDict().finditem("cyclomatic_complexity"));
}
While using the above code in normal java class its working fine and when we run this code using spring boot application its throw below error-
Traceback (most recent call last):
File "script.py", line 4, in
i = lizard.analyze_file("/Users/abcd/Desktop/lizard_code/test.java")
File "/Users/abcd/Desktop/lizard_code/lizard-1.17.10/lizard.py", line 546, in call
return self.analyze_source_code(
File "/Users/abcd/Desktop/lizard_code/lizard-1.17.10/lizard.py", line 546, in call
return self.analyze_source_code(
File "/Users/abcd/Desktop/lizard_code/lizard-1.17.10/lizard_ext/auto_open.py", line 0, in auto_read
File "/Users/abcd/Desktop/lizard_code/lizard-1.17.10/lizard_ext/auto_open.py", line 0, in auto_read
File "/Users/abcd/Desktop/lizard_code/lizard-1.17.10/lizard_ext/auto_open.py", line 21, in auto_open
size = min(32, os.path.getsize(args[0]))
AttributeError: 'javapackage' object has no attribute 'open'
Jython dependency -
org.python
jython-standalone
2.7.3
The text was updated successfully, but these errors were encountered:
pawan-panwar
changed the title
Lizard script doesn't worki with jython in springboot applicatoion
Lizard script doesn't working with jython in springboot applicatoion
Dec 9, 2022
public void result() {
StringWriter output = new StringWriter();
PythonInterpreter pyInterp = new PythonInterpreter();
pyInterp.setOut(output);
pyInterp.exec("import sys");
pyInterp.exec("sys.path.append('/Users/abcd/Desktop/lizard_code/lizard-1.17.10/')");
pyInterp.exec("import lizard");
pyInterp.exec("i = lizard.analyze_file("/Users/abcd/Desktop/lizardcdb_code/test.java")");
pyInterp.exec("s = i.dict.getitem("function_list")");
PyObject x = pyInterp.get("s");
System.out.println(x.getitem(0).getDict().finditem("cyclomatic_complexity"));
While using the above code in normal java class its working fine and when we run this code using spring boot application its throw below error-
Traceback (most recent call last):
File "script.py", line 4, in
i = lizard.analyze_file("/Users/abcd/Desktop/lizard_code/test.java")
File "/Users/abcd/Desktop/lizard_code/lizard-1.17.10/lizard.py", line 546, in call
return self.analyze_source_code(
File "/Users/abcd/Desktop/lizard_code/lizard-1.17.10/lizard.py", line 546, in call
return self.analyze_source_code(
File "/Users/abcd/Desktop/lizard_code/lizard-1.17.10/lizard_ext/auto_open.py", line 0, in auto_read
File "/Users/abcd/Desktop/lizard_code/lizard-1.17.10/lizard_ext/auto_open.py", line 0, in auto_read
File "/Users/abcd/Desktop/lizard_code/lizard-1.17.10/lizard_ext/auto_open.py", line 21, in auto_open
size = min(32, os.path.getsize(args[0]))
AttributeError: 'javapackage' object has no attribute 'open'
Jython dependency -
org.python
jython-standalone
2.7.3
The text was updated successfully, but these errors were encountered: