Futsch1/form-analyzer

View on GitHub
Build fix #66
Futsch1 authored 0e81444c
complete00:00:12
Your first build completed successfully!

Congratulations

Your first build completed successfully!

See the Results

1
git clone
2
codeclimate validate-config
View output
codeclimate validate-config
No errors or warnings found in .codeclimate.json.
3
codeclimate prepare
View output
codeclimate prepare
4
builder pull-engines
View output
determining required images
5
structure
View output
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
6
duplication
View output
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
I, [2024-04-23T05:24:45.752384 #1]  INFO -- : Skipping file ./example/example.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 8
    def one_page_to_two(_: int, image: Image) -> typing.List[form_analyzer.ProcessedImage]:
                         ^
SyntaxError: invalid syntax


I, [2024-04-23T05:24:45.755654 #1]  INFO -- : Skipping file ./example/example_form.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 5
    form_fields: FormFields = [
               ^
SyntaxError: invalid syntax


I, [2024-04-23T05:24:45.763728 #1]  INFO -- : Skipping file ./form_analyzer/analyze.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 16
    title: str
         ^
SyntaxError: invalid syntax


I, [2024-04-23T05:24:45.766963 #1]  INFO -- : Skipping file ./form_analyzer/form_parser.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 13
    page: int
        ^
SyntaxError: invalid syntax


I, [2024-04-23T05:24:45.775502 #1]  INFO -- : Skipping file ./form_analyzer/selectors/text_fields.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 15
    def __init__(self, label: str, filter_: Filter):
                            ^
SyntaxError: invalid syntax


I, [2024-04-23T05:24:45.778273 #1]  INFO -- : Skipping file ./form_analyzer/selectors/single_select.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 25
    def __init__(self, selections: typing.List[str], filter_: Filter, alternative: typing.Union['TextField', 'TextFieldWithCheckbox'] = None,
                                 ^
SyntaxError: invalid syntax


I, [2024-04-23T05:24:45.786891 #1]  INFO -- : Skipping file ./form_analyzer/selectors/select_base.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 15
    match: Match
         ^
SyntaxError: invalid syntax


I, [2024-04-23T05:24:45.793714 #1]  INFO -- : Skipping file ./form_analyzer/selectors/base.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 8
    def simple_str(s: str) -> str:
                    ^
SyntaxError: invalid syntax


I, [2024-04-23T05:24:45.798613 #1]  INFO -- : Skipping file ./form_analyzer/selectors/multi_select.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 25
    def __init__(self, selections: typing.List[str], filter_: Filter, alternative: typing.Union['TextField', 'TextFieldWithCheckbox'] = None,
                                 ^
SyntaxError: invalid syntax


I, [2024-04-23T05:24:45.809592 #1]  INFO -- : Skipping file ./form_analyzer/filters.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 9
    self.__operations: typing.List[typing.Tuple[str, Filter]] = []
                     ^
SyntaxError: invalid syntax


I, [2024-04-23T05:24:45.820330 #1]  INFO -- : Skipping file ./form_analyzer/textract.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 12
    def __init__(self, aws_region_name: str = None,
                                      ^
SyntaxError: invalid syntax


I, [2024-04-23T05:24:45.829161 #1]  INFO -- : Skipping file ./form_analyzer/conversion.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 13
    image: Image
         ^
SyntaxError: invalid syntax
7
sonar-python
sonar-python engine documentation
View output
INFO: Java 1.8.0_111-internal Oracle Corporation (64-bit)
INFO: Linux 4.4.0-1128-aws amd64
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/src/app/build/libs/sonarlint-core-2.17.0.899.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/src/app/build/libs/sonarlint-cli-2.1.0.566.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
INFO: Index files
INFO: Invalid character encountered in file '/code/example/results/form_filled.pdf' at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/example/form/form.xopp' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/example/form/form.pdf' at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: 35 files indexed
ERROR: Unable to parse file: /code/example/example_form.py
ERROR: Parse error at line 5 column 11:

    1: import FormField, FormFields
    2: from form_analyzer.filters import Page, Location
    3: from form_analyzer.selectors import SingleSelect, TextFieldWithCheckbox, MultiSelect, TextField, Placeholder
    4: 
  -->  form_fields: FormFields = [
    6:     FormField('Start with a single select',
    7:               SingleSelect(['Option 1', 'Option 2', 'Option 3'],
    8:                            Page(0) & Location(vertical=(.2,

ERROR: Unable to parse file: /code/form_analyzer/analyze.py
ERROR: Parse error at line 16 column 9:

    7: Worksheet
    8: 
    9: from . import form_parser
   10: from .form_parser import ParsedForm
   11: from .selectors.base import Selector
   12: 
   13: 
   14: @dataclass
   15: class FormField:
  -->      title: str
   17:     selector: Selector
   18: 
   19: 
   20: FormFields = typing.List[FormField]
   21: 
   22: 
   23: class FormDescriptionError(BaseException):
   24:     pass
   25: 
   26: 
   27: def __get_form_description_module

ERROR: Unable to parse file: /code/form_analyzer/form_parser.py
ERROR: Parse error at line 13 column 8:

    1: 
    2: import json
    3: import logging
    4: import os
    5: import typing
    6: from dataclasses import dataclass
    7: 
    8: import trp
    9: 
   10: 
   11: @dataclass
   12: class FieldWithPage:
  -->      page: int
   14:     field: trp.Field
   15: 
   16: 
   17: FieldList = typing.List[FieldWithPage]
   18: 
   19: 
   20: @dataclass
   21: class ParsedForm:
   22:     page_files: typing

ERROR: Unable to parse file: /code/form_analyzer/selectors/select_base.py
ERROR: Parse error at line 15 column 13:

    9: .base import Selector, Match, SimpleField, simple_str
   10: 
   11: 
   12: class Select(Selector, ABC):
   13:     @dataclass
   14:     class SelectionMatch:
  -->          match: Match
   16:         page: int = 0
   17:         uncertain: bool = True
   18: 
   19:         def __eq__(self, other):
   20:             return self.match ==

ERROR: Unable to parse file: /code/form_analyzer/selectors/base.py
ERROR: Parse error at line 22 column 9:

   13: EXACT_SELECTED = 0
   14:     EXACT_NOT_SELECTED = 1
   15:     SIMILAR_SELECTED = 2
   16:     SIMILAR_NOT_SELECTED = 3
   17:     NOT_FOUND = 4
   18: 
   19: 
   20: @dataclass
   21: class FormValue:
  -->      value: str
   23:     page: int
   24:     uncertain: bool = False
   25: 
   26: 
   27: class SimpleField:
   28:     def __init__(self, field_with_page: FieldWithPage):
   29: 

ERROR: Unable to parse file: /code/form_analyzer/filters.py
ERROR: Parse error at line 9 column 25:

    1: import typing
    2: from copy import copy
    3: 
    4: from .form_parser import FieldList
    5: 
    6: 
    7: class Filter:
    8:     def __init__(self):
  -->          self.__operations: typing.List[typing.Tuple[str, Filter]] = []
   10: 
   11:     def __and__(self, other):
   12:         self

ERROR: Unable to parse file: /code/form_analyzer/conversion.py
ERROR: Parse error at line 13 column 9:

    3: import os
    4: import typing
    5: from dataclasses import dataclass
    6: 
    7: import pdf2image
    8: from PIL.Image import Image
    9: 
   10: 
   11: @dataclass
   12: class ProcessedImage:
  -->      image: Image
   14:     extension: str
   15: 
   16: 
   17: ImageProcessor = typing.Callable[[int, Image], typing.List[ProcessedImage]]
   18: 
   19: 
   20: def pdf_to_image

INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.365s
INFO: Final Memory: 6M/295M
INFO: ------------------------------------------------------------------------