Find research datasets worth reusing
Search datasets from major research repositories and use ShareScore to quickly assess how well each record supports discovery, access, and reuse.
19
datasets available to search
ShareScore release 0.9.0
Dataset results
19 results for “code snippets”
Usage and Attribution of Stack Overflow Code Snippets in GitHub Projects — Supplementary Material
<p><em>Background:</em> Stack Overflow (SO) is the largest Q&A website for software developers, providing a huge amount of copyable code snippets. Using those snippets raises various maintenance and legal issues. SO’s license (CC BY-SA 3.0) requires attribution, i.e., referencing the original question or answer, and requires derived work to adopt a compatible license. While there is a heated debate on SO’s license model for code snippets and the required attribution, little is known about the extent to which snippets are copied from SO without proper attribution.</p> <p><em>Aim:</em> Our main goal was to analyze how often code from SO posts is used in public GitHub projects, but not attributed as required by the license. Further, we wanted to investigate if developers are aware of SO’s license and its implications, and to what degree they adhere to the attribution requirements defined in SO’s terms of service.</p> <p><em>Method:</em> We present results of a large-scale empirical study analyzing the usage and attribution of non-trivial Java code snippets from SO answers in public GitHub projects. We followed three different approaches to triangulate an estimate for the ratio of unattributed usages and conducted two online surveys with software developers to complement our results.</p> <p><em>Results:</em> For the different sets of projects that we analyzed, the amount of projects containing files with a reference to SO varied between 3.3% and 11.9%. We found that at most 1.8% of all analyzed repositories containing code from SO used the code in a way compatible with CC BY-SA 3.0. Moreover, we estimate that at most a quarter of the copied code snippets from SO are attributed as required, i.e., using a link in a source code comment. About half of the surveyed developers admitted copying code from SO without attribution. Furthermore, about two thirds of them were not aware of the license of SO code snippets and its implications.</p>
Pylint Results for Python Code Snippets on Stack Overflow
<p>This dataset contains valid pylint results for all Stack Overflow code snippets from SOTorrent that meet the following criteria</p> <ul> <li>Tagged with 'python'</li> <li>6 lines and above</li> <li>Contains basic python syntax (i.e. 'print', 'import', '(', '=')</li> <li>Produces a result when processed by Pylint</li> </ul>
Mining Rule Violations in JavaScript Code Snippets
<p><strong>Content of this repository</strong><br> This is the repository that contains the scripts and dataset for the MSR 2019 mining challenge</p> <p>Github Repository with the software used : <a href="https://github.com/urielfcampos/linting-js-codesnippets">here</a>.<br> =======</p> <p><strong>DATASET</strong><br> The dataset was retrived utilizing google bigquery and dumped to a csv<br> file for further processing, this original file with no treatment is called jsanswers.csv, here we can find the following information :<br> 1. The Id of the question (PostId)<br> 2. The Content (in this case the code block)<br> 3. the lenght of the code block<br> 4. the line count of the code block<br> 5. The score of the post<br> 6. The title</p> <p>A quick look at this files, one can notice that a postID can have multiple rows related to it, that's how multiple codeblocks are saved in the database.</p> <p><strong>Filtered Dataset:</strong></p> <p><strong>Extracting code from CSV</strong><br> We used a python script called "ExtractCodeFromCSV.py" to extract the code from the original csv and merge all the codeblocks in their respective javascript file with the postID as name, this resulted in 336 thousand files.</p> <p><strong>Running ESlint</strong><br> Due to the single threaded nature of ESlint, we needed to create a script to run ESlint because it took a huge toll on the machine to run it on 336 thousand files, this script is named "ESlintRunnerScript.py", it splits the files in 20 evenly distributed parts and runs 20 processes of esLinter to generate the reports, as such it generates 20 json files.</p> <p><strong>Number of Violations per Rule</strong><br> This information was extracted using the script named "parser.py", it generated the file named "NumberofViolationsPerRule.csv" which contains the number of violations per rule used in the linter configuration in the dataset.</p> <p><strong>Number of violations per Category</strong><br> As a way to make relevant statistics of the dataset, we generated the number of violations per rule category as defined in the eslinter website, this information was extracted using the same "parser.py" script.</p> <p><strong>Individual Reports</strong><br> This information was extracted from the json reports, it's a csv file with PostID and violations per rule.</p> <p><strong>Rules</strong><br> The file Rules with categories contains all the rules used and their categories.</p> <p> </p>
Analyzing the Impact of Copying-and-Pasting Vulnerable Solidity Code Snippets from Question-and-Answer Websites
<p>This data comprises all input and output, including intermediate results for the evaluation of the tool cpg-contract-checker(CCC) and the crawled data and results for the study published under the name "Analyzing the Impact of Copying-and-Pasting Vulnerable Solidity Code Snippets from Question-and-Answer Websites".<br>We conducted a study on the impact of vulnerable code reuse from Q&A websites during the development of smart contracts and provided tools uniquely fit to detect vulnerable code patterns in complete and incomplete Smart Contract code. The paper proposes a pattern-based vulnerability detection tool that is able to analyze code snippets (i.e., incomplete code) as well as full smart contracts based on the concept of code property graphs. We also propose a methodology that leverages fuzzy hashing to quickly detect code clones of vulnerable snippets among deployed smart contracts. Our results show that our vulnerability search, as well as our code clone detection, are comparable to state-of-the-art while being applicable to code snippets. The tools are used to realize a study pipeline for which the dataset and (intermediate) results are contained in this archive.</p>
Source Code Snippets and Quality Analytics Dataset
<p>This dataset contains the Java code snippets of <a href="https://github.com/github/CodeSearchNet">CodeSearchNet</a>, processed along with their abstract syntax trees and clustered according to their similarity. It also includes static analysis metrics, PMD violations and readability metrics for each snippet.</p> <p>You can use the dataset simply with the following steps:</p> <p> 1. Download the data.</p> <p> 2. Navigate to the download folder and use the mongorestore (<a href="https://docs.mongodb.com/manual/reference/program/mongorestore/">https://docs.mongodb.com/manual/reference/program/mongorestore/</a>) command. (Have in mind to use the --gzip flag)</p>
Java code snippets from SOTorrent v23-09-2019
<p>These data is an extraction of the Java code snippets from the snapshot in SOTorrent dated in 23-09-2019. The CSV file contains five fields: Question_ID, Answer_ID, Body, Tags and Score.</p>
Replication Package for the Paper: "Understanding Code Snippets in Code Reviews: A Preliminary Study of the OpenStack Community"
<p>This is the replication package for the paper: "Understanding Code Snippets in Code Reviews: A Preliminary Study of the OpenStack Community", including dataset and so on (see the description below) : </p> <ul> <li> <p><strong>Data of Code Snippets in Code Review.xlsx</strong> is the dataset of our paper, which contains 10,790 review comments collected from the Nova project and Neutron project of OpenStack community. Among all the review comments, 626 review comments contain code snippets. For the rows of review comments with code snippets, we filled them with blue color as an indicator.</p> </li> <li> <p><strong>Examples for Each Purpose.xlsx</strong> contains six review comment examples for the six detailed purposes mentioned in our paper (see Section 4.2).</p> </li> <li> <p><strong>README.md</strong></p> </li> </ul>
StackPilot: Contrasting Code Snippets from Stack Overflow and GitHub Copilot
<p>Copy-paste programming via Stack Overflow and code generation via GitHub Copilot both define a query/prompt-based programming model. To enable systematic comparison of code copied from Stack Overflow and code generated by GitHub Copilot, we provide a dataset of 30,746 code snippets that Stack Overflow and GitHub Copilot produced in response to the same 2,636 queries/prompts.</p>
List Vulnerable Code Snippets
<p>This database contains a list of pointers to freely available online sources containing vulnerable (non-compliant) code snippets and also non-vulnerable (compliant) code snippets for different programming languages. These code snippets can be used to train machine learning algorithms, as discussed in our publication in CYBER22 entitled "How Good is Openly Available Code Snippets Containing Software Vulnerabilities to Train Machine Learning Algorithms?". Due to potential copyright issues, the snippets are not included in the database. However, using the links provided, these can be easily obtained.</p>
Data, code snippets, and resources of BMF CP51: Political ideology, climate change belief, and potable water reuse willingness in the USA
<p>The dataset, data description, code snippets, and figures related to the Bayesian analysis of BMF CP 51 on SM3D Portal were uploaded to Zenodo to enhance transparency and assist in later replication and validation (https://mindsponge.info/posts/246). The original dataset can be found at: https://www.sciencedirect.com/science/article/pii/S2352340920301839</p>
Does Location Influence Code Quality? Mining Stack Overflow Snippets Across the United States – Replication Package
<p>Developers routinely integrate Stack Overflow code snippets into their codebases. However, the quality of snippets embedded in users’ answers remain elusive, and existing evaluations of code quality tend to be language or context-specific. Moreover, literature have found that contribution patterns vary depending on geographical locales, creating an unexplained rift between code quality, user location, and latent contextual regional factors. </p> <p>The proposed study evaluates the quality of SQL, JavaScript, Python, Ruby, and Java snippets across reliability, readability, performance, and security dimensions, benchmarking findings across states in the USA and investigating how different diversity indicators correlate against code quality violations. The study culminates in a series of inductive content analyses that qualitatively supplement prior quality dimensions.</p> <p>This replication package is provided for those interested in further examining our research methodology.</p>
APIzation: Generating Reusable APIs from StackOverflow Code Snippets - Replication Package
<p>This repository represents the replication package for the paper <em>APIzation: Generating Reusable APIs from StackOverflow Code Snippets</em>.</p> <p>The paper is published in the proceeding of the <em>36th IEEE/ACM International Conference on Automated Software Engineering (ASE)</em>.</p> <p>In this replication package, we provide all the <em>APIzations</em> we produced with our tool. Also, we include the data we used for our evaluation.</p>
Do Developers Present Proficient Code Snippets in Their README Files? An Analysis of PyPI Libraries in GitHub
<p><strong>Abstract:</strong><br> A README file plays an essential role as the face of a software project and the initial point of contact for developers in Open Source Software (OSS) projects. The code snippet is one of the most important contents in the README file for demonstrating the usage of software and APIs. Presenting easy to comprehend code snippets are preferred by developers to quickly understand the usage and features of the software. However, README files may contain proficient code snippets due to readability and performance reasons. In this paper, we first investigate the prevalence of each competency level of Python code snippets in the README files. Then, we analyze the relationships between the usage of proficient code snippets and topics of libraries. From our empirical study on 1,620 README files of PyPI libraries, we find that developers mainly present 92% of basic elements and 7% of independent elements in code snippets of the README files. However, developers may present proficient elements in code snippets for Application Framework, Quality Assurance, and User Interface libraries. Thus, we encourage developers to (i) write basic README files to attract more newcomers or (ii) write proficient README files to introduce effective usage of PyPI libraries.</p>
NPM Code Snippets and Package Information
<p>Contains two JSON files, snippets and package info.</p> <p>The snippets file contains code snippets extracted from npm package readme files, as well as descriptions. The code snippets were extracted by looking for markdown code fences. For code highlighting, some fences contain language information - all non-js code snippets were excluded. Code snippets that only contained a javascript object were also excluded, as these were often snippets showing the results of some functionality, or settings.</p> <p>Descriptions were extracted, in summary, by looking for code above the snippet.</p> <p>Package info comes from Libraries.io, containing only packages that have code snippets. This includes repository information like number of forks, stars, etc.</p> <p>The original npm readme files dataset and npm package info datasets are also available for download:</p> <pre>https://doi.org/10.5281/zenodo.3898749 https://doi.org/10.5281/zenodo.3836540 </pre>
Dataset of the Paper: Demystifying Code Snippets in Code Reviews: A Study of the OpenStack and Qt Communities and A Practitioner Survey
<p>This dataset, which is composed of two parts: the code review data collected from OpenStack and Qt, and the survey data collected from industrial developers, was used to conduct an empirical study on code snippets in code reviews. A brief description of each part of the dataset is provided below:</p> <p><strong>1. Dataset (OpenStack+Qt).xlsx</strong></p> <p>contains 127,182 review comments mined from four popular projects of the OpenStack community (Nova and Neutron) and the Qt community (Qt Base and Qt Creator) from 2020 to 2021. Among the review comments, 3,197 review comments contain code snippets. In the Excel file, for the rows of review comments with code snippets, we marked the code snippets in red color as an indicator.</p> <p><strong>2. Dataset (Survey).xlsx</strong></p> <p>contains 63 valid responses to our survey questionnaire from industrial developers of OpenStack, Qt, and LinkedIn.</p>
Snippet Comment Generation Based on Code Context Expansion
<p>Dataset of the TOSEM accepted paper "Snippet Comment Generation Based on Code Context Expansion".</p> <p>Version 2 adds dictionary files.</p>
How do developers use Code Snippets in README files? Analyzing between Python Software Development and Scientific Libraries
<p>README files contain crucial information for clients to effectively use the software.<br> However, we sometimes found that developers either present insufficient content or leave the README files empty.<br> Recent works suggest that, in popular repositories, developers tend to present more code snippets in their README files.<br> In this study, we investigate how developers present code snippets in 10,784 README files of PyPI libraries in terms of (i) the types of code snippets and (ii) the sections where code snippets are presented.<br> Our results indicate the prevalence of types of code snippets in various sections across different types of libraries.</p>
Assessing Code Readability in Python Programming Courses Using Eye-Tracking - Python Code Snippets
<p>Python code snippets for assessing code readability in Python programming courses using eye-tracking.</p>
Dataset for the paper: Generating Question Titles for Stack Overflow from Mined Code Snippets
<p>This is the dataset for our paper: Generating Question Titles for Stack Overflow from Mined Code Snippets</p> <p>All the data are extracted from the Stack Overflow data dump, please feel free to use! :)</p>
ScienceDex guides
Understand access before you commit
These curated guides explain access requirements, typical timelines, costs, and reuse considerations for widely used research datasets.
Allen Brain Atlas
Allen Brain Atlas is an Allen Institute collection of brain map atlases, datasets, APIs, and analysis tools covering mouse, human, and non-human primate brain resources.
Annotated Behaviour and Observability Dataset (ABODe)
ABODe is a University of Edinburgh DataShare dataset for behavior classification in group-housed mice using home-cage video, identities, bounding boxes, ground-plate positions, and annotator labels.
DANDI Archive for NWB datasets
DANDI is a BRAIN Initiative archive for publishing and sharing neurophysiology data, including electrophysiology, optophysiology, and behavioral data packaged as NWB and related standards.
International Brain Laboratory public data
The International Brain Laboratory public data releases expose standardized mouse decision-making experiments, including Neuropixels recordings, widefield calcium imaging, behavior, and session metadata accessed through the ONE API.
OpenNeuro
OpenNeuro is a free, open platform for sharing neuroimaging datasets, with public search, dataset pages, and download paths for web, S3, DataLad, and the OpenNeuro CLI.