Parse the test results and convert to the MethodInfo fields
767443
private void parseResults() {
        logger.entering();

        if (result.getStatus() == ITestResult.SUCCESS) {
            this.status = "Passed";
        } else if (result.getStatus() == ITestResult.FAILURE) {
            this.status = "Failed";
        } else if (result.getStatus() == ITestResult.SKIP) {
            this.status = "Skipped";
        } else if (result.getStatus() == ITestResult.STARTED) {
            this.status = "Running";
        }

        Calendar c = Calendar.getInstance();
        c.setTimeInMillis(result.getStartMillis());
        this.startTime = ReporterDateFormatter.getISO8601String(c.getTime());
        c.setTimeInMillis(result.getEndMillis());
        this.endTime = ReporterDateFormatter.getISO8601String(c.getTime());

        if (result.getMethod().getDescription() != null) {
            this.description = result.getMethod().getDescription();
        }

        if (result.getThrowable() != null) {
            this.exception = result.getThrowable().getClass().toString() + ":"
                    + result.getThrowable().getLocalizedMessage();
            this.stacktrace = getStackTraceInfo(result.getThrowable());
        }

        loadMethodInfo(result);

        logger.exiting();
    }
764208
static function transformGetFunctionsResults( $results, $rname, $method = '' )
    {
        switch( $rname )
        {
            case 'system.listMethods':
                foreach ( $results as $key => $value )
                {
                    $results[$key] = preg_replace( array( '/^([^ ]+ )/', '/(\(.+)$/' ), '', $value );
                }
                return $results;
                break;
            case 'system.methodHelp':
                return ''; /// @todo
                break;
            case 'system.methodSignature':
                foreach ( $results as $key => $value )
                {
                    if ( preg_match( '/^([^ ]+) ([^\(]+)\((.+)\)$/', $value, $matches ) )
                    {
                        if ( $method == $matches[2] )
                        {
                            $params = array( $matches[1] );
                            foreach( explode( ', ', $matches[3] ) as $param )
                            {
                                $param = explode( ' ', $param, 2 );
                                $name = substr( $param[1], 1); // php likes dollars in var names
                                $params[$name] = $param[0];
                            }
                            return array( $params );
                        }
                    }
                }
                return array(); /// @todo return error 'method not found'
                break;
        } // switch
    }
938115
private Set<String> determineReturnTypes(final MethodResult result) {
        final List<Instruction> visitedInstructions = interpretRelevantInstructions(result.getInstructions());

        // find project defined methods in invoke occurrences
        final Set<ProjectMethod> projectMethods = findProjectMethods(visitedInstructions);

        // add project methods to global method pool
        projectMethods.forEach(MethodPool.getInstance()::addProjectMethod);

        final Element returnedElement = simulator.simulate(visitedInstructions);
        if (returnedElement == null) {
            // happens for abstract methods or if there is no return
            return singleton(result.getOriginalMethodSignature().getReturnType());
        }

        return returnedElement.getTypes();
    }
482029
def add_parser_from_field(self, name, field_cls):
        """"""
        self.__parser_map__[name] = _field2method(field_cls, method_name=name)
833626
def parse_method_signature(sig):
    
    match = METH_SIG_RE.match(sig.strip())
    if not match:
        raise RuntimeError('Method signature invalid: ' + sig)
    modifiers, return_type, name, generic_types, params = match.groups()
    if params.strip() != '':
        params = split_sig(params)
        params = [parse_param_signature(x) for x in params]
    else:
        params = []
    return (modifiers.split(), return_type, name, generic_types, params)
1370234
def action_parse_results(result):
    
    passed = True
    for test, result in result.items():
        if result['success']:
            hookenv.action_set({test: 'PASS'})
        else:
            hookenv.action_set({test: 'FAIL - {}'.format(result['message'])})
            passed = False
    if not passed:
        hookenv.action_fail("One or more tests failed")
    return 0 if passed else 1
394754
def __parse_results(self,results):
        
        reslist = []
        cursor = 0
        match  = RE_RESULTS.search(results,cursor)
        while match:
            doc = {}
            doc['bibcode'] = match.group('bibcode')
            doc['confidence'] = self.__get_confidence_level(match.group('confidence'))
            doc['refstring'] = match.group('refstring')
            reslist.append(doc)
            cursor = match.end()
            match  = RE_RESULTS.search(results,cursor)
        return reslist
934629
@Override
    public void parse(ClassInfo.Builder builder) throws InvalidClassFileFormatException {
        parse((ClassNameAndSuperclassInfo.Builder) builder);

        final List<FieldDescriptor> fieldDescriptorList = new LinkedList<>();
        final List<MethodDescriptor> methodDescriptorList = new LinkedList<>();
        final TreeSet<ClassDescriptor> referencedClassSet = new TreeSet<>();
        javaClass.accept(new AnnotationVisitor() {
            @Override
            public void visit(Method obj) {
                methodDescriptorList.add(parseMethod(obj));
            }

            @Override
            public void visit(Field obj) {
                fieldDescriptorList.add(parseField(obj));
            }

            @Override
            public void visit(ConstantClass obj) {
                @SlashedClassName
                String className = obj.getBytes(javaClass.getConstantPool());
                if (className.indexOf('[') >= 0) {
                    ClassParser.extractReferencedClassesFromSignature(referencedClassSet, className);
                } else if (ClassName.isValidClassName(className)) {
                    referencedClassSet.add(DescriptorFactory.instance().getClassDescriptor(className));
                }
            }

            @Override
            public void visit(ConstantNameAndType obj) {
                String signature = obj.getSignature(javaClass.getConstantPool());
                ClassParser.extractReferencedClassesFromSignature(referencedClassSet, signature);
            }
        });

    }
1061904
protected void collectMethods(Class<? extends AbstractExtraLanguageValidator> clazz,
			Collection<Class<?>> visitedClasses,
			Collection<MethodWrapper> result) {
		if (!visitedClasses.add(clazz)) {
			return;
		}
		for (final Method method : clazz.getDeclaredMethods()) {
			if (method.getAnnotation(Check.class) != null && method.getParameterTypes().length == 1) {
				result.add(createMethodWrapper(method));
			}
		}
		final Class<? extends AbstractExtraLanguageValidator> superClass = getSuperClass(clazz);
		if (superClass != null) {
			collectMethods(superClass, visitedClasses, result);
		}
	}
1052522
private function extractExtendedParametersInfo(): void
  {
    $key = array_search('begin', $this->routineSourceCodeLines);

    if ($key!==false)
    {
      for ($i = 1; $i<$key; $i++)
      {
        $k = preg_match('/^\s*--\s+param:(?:\s*(\w+)\s+(\w+)(?:(?:\s+([^\s-])\s+([^\s-])\s+([^\s-])\s*$)|(?:\s*$)))?/',
                        $this->routineSourceCodeLines[$key - $i + 1],
                        $matches);

        if ($k==1)
        {
          $count = count($matches);
          if ($count==3 || $count==6)
          {
            $parameter_name = $matches[1];
            $data_type      = $matches[2];

            if ($count==6)
            {
              $list_delimiter = $matches[3];
              $list_enclosure = $matches[4];
              $list_escape    = $matches[5];
            }
            else
            {
              $list_delimiter = ',';
              $list_enclosure = '"';
              $list_escape    = '\\';
            }

            if (!isset($this->extendedParameters[$parameter_name]))
            {
              $this->extendedParameters[$parameter_name] = ['name'      => $parameter_name,
                                                            'data_type' => $data_type,
                                                            'delimiter' => $list_delimiter,
                                                            'enclosure' => $list_enclosure,
                                                            'escape'    => $list_escape];
            }
            else
            {
              throw new RoutineLoaderException("Duplicate parameter '%s'", $parameter_name);
            }
          }
          else
          {
            throw new RoutineLoaderException('Error: Expected: -- param: <field_name> <type_of_list> [delimiter enclosure escape]');
          }
        }
      }
    }
  }
606018
def _parse_view_results(self, rows, factory, options):
        '''
        
        '''
        kwargs = dict()
        kwargs['reduced'] = factory.use_reduce and options.get('reduce', True)
        kwargs['include_docs'] = options.get('include_docs', False)
        # Lines below pass extra arguments to the parsing function if they
        # are expected. These arguments are bound method unserialize() and
        # unserialize_list(). They methods perform the magic of parsing and
        # upgrading if necessary the loaded documents.

        spec = inspect.getargspec(factory.parse_view_result)
        if 'unserialize' in spec.args:
            kwargs['unserialize'] = self.unserialize_document
        if 'unserialize_list' in spec.args:
            kwargs['unserialize_list'] = self.unserialize_list_of_documents
        return factory.parse_view_result(rows, **kwargs)
277485
private void parseField()
    throws IOException
  {
    int accessFlags = readShort();
    int nameIndex = readShort();
    int descriptorIndex = readShort();

    JavaField field = new JavaField();
    field.setJavaClass(_class);
    field.setName(_cp.getUtf8(nameIndex).getValue());
    field.setDescriptor(_cp.getUtf8(descriptorIndex).getValue());
    field.setAccessFlags(accessFlags);

    int attributesCount = readShort();

    for (int i = 0; i < attributesCount; i++) {
      Attribute attr = parseAttribute();

      field.addAttribute(attr);
    }

    _class.addField(field);
  }
1329735
private String getMethodName(Method method) {
        StatName statName = method.getAnnotation(StatName.class);
        return statName == null ? method.getName() : statName.value();
    }
563889
final public void MethodParameters() throws ParseException {
                                             /*@bgen(jjtree) MethodParameters */
  AstMethodParameters jjtn000 = new AstMethodParameters(JJTMETHODPARAMETERS);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      jj_consume_token(LPAREN);
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case START_SET_OR_MAP:
      case INTEGER_LITERAL:
      case FLOATING_POINT_LITERAL:
      case STRING_LITERAL:
      case TRUE:
      case FALSE:
      case NULL:
      case LPAREN:
      case LBRACK:
      case NOT0:
      case NOT1:
      case EMPTY:
      case MINUS:
      case IDENTIFIER:
        Expression();
        label_15:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case COMMA:
            ;
            break;
          default:
            jj_la1[37] = jj_gen;
            break label_15;
          }
          jj_consume_token(COMMA);
          Expression();
        }
        break;
      default:
        jj_la1[38] = jj_gen;
        ;
      }
      jj_consume_token(RPAREN);
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  }
129848
def printComparison(results, class_or_prop):
	

	data = []

	Row = namedtuple('Row',[class_or_prop,'VALIDATED'])

	for k,v in sorted(results.items(), key=lambda x: x[1]):
		data += [Row(k, str(v))]

	pprinttable(data)
681537
def parse_result(cls, result):
        
        if len(result) == 3:
            items, count, context = result
        else:
            context = {}
            items, count = result
        return items, count, context
416374
@SuppressWarnings("rawtypes")
    protected void parseMethod(Object value, GetterMethodCover method,
            ISFSObject sfsObject) {
        Object answer = value;
        if(method.isColection()) {
            answer = parseCollection(method, (Collection)value);
        }
        else if(method.isTwoDimensionsArray()) {
            answer = parseTwoDimensionsArray(method, value);
        }
        else if(method.isArray()) {
            answer = parseArray(method, value);
        }
        else if(method.isObject()) {
            answer = parseObject(method, value);
        }
        else if(method.isChar()) {
            answer = (byte)(((Character)value).charValue());
        }
        SFSDataType type = getSFSDataType(method);
        sfsObject.put(method.getKey(), new SFSDataWrapper(type, answer));
    }