From 82a505b60a9652d15773b33dd5523cb9f5bf7bed Mon Sep 17 00:00:00 2001 From: Claudio Maggioni Date: Tue, 18 Apr 2023 13:49:07 +0200 Subject: [PATCH] report part 1 done --- extract_feature_vectors.py | 7 +++-- ...org.apache.xerces.dom.CoreDocumentImpl.csv | 2 +- report/main.md | 29 +++++++++++++++--- report/main.pdf | Bin 143671 -> 189022 bytes 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/extract_feature_vectors.py b/extract_feature_vectors.py index ccc2a44..8e18a44 100755 --- a/extract_feature_vectors.py +++ b/extract_feature_vectors.py @@ -85,12 +85,16 @@ def parse(path: str): # consider only the class matching the input file name, to skip inner classes if path.endswith(node.name + '.java'): fqdn = package_name + '.' + node.name + print(fqdn) fields = get_fields(node) methods = get_methods(node) cols = sorted(fields.union(methods)) + print("# Attributes", len(cols)) + print("# Feature vectors", len(node.methods)) + df = pd.DataFrame(columns=cols, dtype=int) for m in node.methods: # make sure method is included in csv file @@ -100,9 +104,6 @@ def parse(path: str): m_methods = get_methods_accessed_by_method(m, methods) for member in m_fields.union(m_methods): - if member not in fields and member not in methods: - print(member) - df.loc[m.name, member] = 1 df = df.fillna(0) diff --git a/feature_vectors/org.apache.xerces.dom.CoreDocumentImpl.csv b/feature_vectors/org.apache.xerces.dom.CoreDocumentImpl.csv index 8cfc2e9..c584f31 100644 --- a/feature_vectors/org.apache.xerces.dom.CoreDocumentImpl.csv +++ b/feature_vectors/org.apache.xerces.dom.CoreDocumentImpl.csv @@ -1,4 +1,4 @@ -,abort,actualEncoding,addEventListener,adoptNode,allowGrammarAccess,callUserDataHandlers,canRenameElements,changed,changes,checkDOMNSErr,checkNamespaceWF,checkQName,clearIdentifiers,clone,cloneNode,copyEventListeners,createAttribute,createAttributeNS,createCDATASection,createComment,createDocumentFragment,createDocumentType,createElement,createElementDefinition,createElementNS,createEntity,createEntityReference,createNotation,createProcessingInstruction,createTextNode,deletedText,dispatchEvent,docElement,docType,documentNumber,domNormalizer,encoding,errorChecking,fConfiguration,fDocumentURI,fFreeNLCache,fXPathEvaluator,freeNodeListCache,getAsync,getBaseURI,getDoctype,getDocumentElement,getDocumentURI,getDomConfig,getElementById,getElementsByTagName,getElementsByTagNameNS,getEncoding,getErrorChecking,getFeature,getIdentifier,getIdentifiers,getImplementation,getInputEncoding,getMutationEvents,getNodeListCache,getNodeName,getNodeNumber,getNodeType,getOwnerDocument,getStandalone,getStrictErrorChecking,getTextContent,getUserData,getUserDataRecord,getVersion,getXmlEncoding,getXmlStandalone,getXmlVersion,identifiers,importNode,insertBefore,insertedNode,insertedText,insertingNode,isKidOK,isNormalizeDocRequired,isValidQName,isXML11Version,isXMLName,isXMLVersionChanged,kidOK,load,loadXML,modifiedAttrValue,modifiedCharacterData,modifyingCharacterData,nodeCounter,nodeTable,normalizeDocument,putIdentifier,readObject,removeChild,removeEventListener,removeIdentifier,removeUserDataTable,removedAttrNode,removedNode,removingNode,renameNode,renamedAttrNode,renamedElement,replaceChild,replaceRenameElement,replacedCharacterData,replacedNode,replacedText,replacingData,replacingNode,saveXML,serialVersionUID,setAsync,setAttrNode,setDocumentURI,setEncoding,setErrorChecking,setInputEncoding,setMutationEvents,setStandalone,setStrictErrorChecking,setTextContent,setUserData,setUserDataTable,setVersion,setXmlEncoding,setXmlStandalone,setXmlVersion,standalone,undeferChildren,userData,version,writeObject,xml11Version,xmlVersionChanged,Node,UserDataHandler,kid,DOMMessageFormatter,DOMException,NamespaceContext +,abort,actualEncoding,addEventListener,adoptNode,allowGrammarAccess,callUserDataHandlers,canRenameElements,changed,changes,checkDOMNSErr,checkNamespaceWF,checkQName,clearIdentifiers,clone,cloneNode,copyEventListeners,createAttribute,createAttributeNS,createCDATASection,createComment,createDocumentFragment,createDocumentType,createElement,createElementDefinition,createElementNS,createEntity,createEntityReference,createNotation,createProcessingInstruction,createTextNode,deletedText,dispatchEvent,docElement,docType,documentNumber,domNormalizer,encoding,errorChecking,fConfiguration,fDocumentURI,fFreeNLCache,fXPathEvaluator,freeNodeListCache,getAsync,getBaseURI,getDoctype,getDocumentElement,getDocumentURI,getDomConfig,getElementById,getElementsByTagName,getElementsByTagNameNS,getEncoding,getErrorChecking,getFeature,getIdentifier,getIdentifiers,getImplementation,getInputEncoding,getMutationEvents,getNodeListCache,getNodeName,getNodeNumber,getNodeType,getOwnerDocument,getStandalone,getStrictErrorChecking,getTextContent,getUserData,getUserDataRecord,getVersion,getXmlEncoding,getXmlStandalone,getXmlVersion,identifiers,importNode,insertBefore,insertedNode,insertedText,insertingNode,isKidOK,isNormalizeDocRequired,isValidQName,isXML11Version,isXMLName,isXMLVersionChanged,kidOK,load,loadXML,modifiedAttrValue,modifiedCharacterData,modifyingCharacterData,nodeCounter,nodeTable,normalizeDocument,putIdentifier,readObject,removeChild,removeEventListener,removeIdentifier,removeUserDataTable,removedAttrNode,removedNode,removingNode,renameNode,renamedAttrNode,renamedElement,replaceChild,replaceRenameElement,replacedCharacterData,replacedNode,replacedText,replacingData,replacingNode,saveXML,serialVersionUID,setAsync,setAttrNode,setDocumentURI,setEncoding,setErrorChecking,setInputEncoding,setMutationEvents,setStandalone,setStrictErrorChecking,setTextContent,setUserData,setUserDataTable,setVersion,setXmlEncoding,setXmlStandalone,setXmlVersion,standalone,undeferChildren,userData,version,writeObject,xml11Version,xmlVersionChanged,Node,UserDataHandler,kid,DOMException,DOMMessageFormatter,NamespaceContext getOwnerDocument,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 getNodeType,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0 getNodeName,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/report/main.md b/report/main.md index 8aa264d..291bfcd 100644 --- a/report/main.md +++ b/report/main.md @@ -1,6 +1,7 @@ --- author: Claudio Maggioni title: Information Modelling & Analysis -- Project 1 +geometry: margin=2.5cm,bottom=3cm ---