UVicDSA18
  • Introduction
  • Keras
    • 1. Introduction
    • 2. Documentation Overview
    • 3. Stakeholders
    • 4. Business Goals
    • 5. Architecturally Significant Requirements
    • 6. Module View
      • Main Diagram
      • Element Catalogue
      • Context Diagram
      • Behaviour Diagrams
      • Module Organization Rationale
    • 7.Component and Connector View
      • Main Presentation
      • Element Catalog
        • Elements
        • Relations
        • Interfaces
      • Context Diagram
      • Behavior Diagrams
        • Building a Sequential Model
        • Training a Model
      • Variability Guide
      • Rationale
    • 8. Code Quality and Technical Debt
      • Code Quality Report
        • Introduction
        • Code Quality Issues
      • Potential Technical Debt
        • Introduction
        • Length and Complexity Issues
        • Backend Conditional Code Paths
      • Conclusion
    • 9. Conclusion
    • 10. References
  • Tensorboard
    • List of Figures
    • 1.0 Introduction
    • 2.0 Identifying Stakeholders and Business Goals
      • 2.1 Stakeholders
      • 2.2 Business Goals
    • 3.0 Architecturally Significant Requirements and Utility Tree
      • 3.1 List of Architecturally Significant Requirements
      • 3.2 Prioritized List of Scenarios
      • 3.3 Quality Attribute Scenario Templates
      • 3.4 Utility Tree
    • 4.0 Module View
      • 4.1 Primary Presentation
      • 4.2 Element Catalog
      • 4.3 Context Diagram
      • 4.4 Sequence Diagram
      • 4.5 Rationale
    • 5.0 Component and Connector View
      • 5.1 Primary Presentation
      • 5.2 Element Catalog
        • 5.2.1 Elements and Properties
        • 5.2.2 Relations and Properties
        • 5.2.3 Elements Interfaces
          • Loading Events from a Directory File
          • Processing and Prepare to Load Events into Plugins
        • 5.2.4 Element Behaviour
      • 5.3 Context Diagram
      • 5.4 Variability Guide
      • 5.5 Rationale
    • 6.0 Technical Debt
      • 6.1 SonarQube Analysis
        • 6.1.1 Function Names
        • 6.1.2 Methods and Field Name Capitalization
        • 6.1.3 Cognitive Complexity of the Code
        • 6.1.4 Merging Collapsible “if” Statements
        • 6.1.5 Reducing Code Duplications
      • 6.2 CodeScene Analysis
        • 6.2.1 Hotspots
        • 6.2.2 Refactoring Targets
        • 6.2.3 Code Age
        • 6.2.4 Internal Temporal Coupling
      • 6.3 Technical Debt Recommendations
        • 6.3.1 Duplications and Refactoring
        • 6.3.2 Function Recommendation
        • 6.3.3 Stability
        • 6.3.4 Absence of a Dataset Module
        • 6.3.5 Compatibility of Multiple Browsers
        • 6.3.6 “TODO” Search and Analysis
        • 6.3.7 Other Recommendations
      • 6.4 Technical Debt Summary and Conclusions
    • 7.0 Pull Request
      • 7.1 Problem Description
      • 7.2 Solution
    • 8.0 Conclusions
    • 9.0 References
  • Toyplot
  • Strapi
    • Purpose
    • About Strapi System
    • Stakeholders
    • Business Goals
    • Architecturally Significant Requirements (ASR)
    • Utility Tree
    • Quality Attribute Scenarios (QAS)
    • Module View
      • Primary Presentation
      • Element Catalog
        • Elements and Properties
        • Relations and Properties
        • Element Behaviour
      • Context Diagram
      • Rationale
    • Component and Connector View
      • Primary Presentation
      • Element Catalog
        • Elements and Properties
        • Relations and Properties
        • Element Behaviour
      • Context Diagram
      • Variability Guide
      • Rationale
    • Code Quality and Technical Debt
    • Conclusion
  • Cartographer
    • 1.0 Introduction
    • 2.0 Stakeholder Analysis
    • 3.0 Architecturally Significant Requirements
    • 4.0 Module View
    • 5.0 Component and Connector View
    • 6.0 Code Quality Review
    • 7.0 Conclusion
    • 8.0 References
  • RocketChat
    • Abstract
    • 1. Introduction
      • 1.1 Project overview
      • 1.2 About RocketChat
      • 1.3 Our Project Team
    • 2. Stakeholders and Business Goals
      • 2.1 Stakeholders
      • 2.2 Business Goals
    • 3. Architecturally Significant Requirements
      • 3.1 ASR
      • 3.2 Utility Tree
      • 3.3 Quality Attribute Scenario
    • 4. Module View
      • 4.1 Primary Presentation
      • 4.2 Element Catalog
      • 4.3 Context Diagram
      • 4.4 Behaviour Diagram
      • 4.5 Rationale
    • 5. Component and Connector View
      • 5.1 Primary Presentation
      • 5.2 Element Catalog
      • 5.3 Behaviour Diagram
      • 5.4 Interface Documentation
      • 5.5 Rationale
    • 6. Code Quality and Technical Debt
      • 6.1 Code Quality Analysis Tools
        • 6.1.1 SonarQube
        • 6.1.2 CodeScene
    • 7. Conclusion
    • References
  • SwaggerUI
  • Homebrew
    • 1. Introduction
      • 1.1 Project Overview
      • 1.2 Our Project Team
      • 1.3 Our Supervisors
    • 2. Identifying Project Stakeholders and Business Goals
      • 2.1 Stakeholders
      • 2.2 Business Goals
    • 3. Architecturally Significant Requirements and Utility Tree
      • 3.1 Architecturally Significant Requirements
      • 3.2 Utility Tree
      • 3.3 Quality Attribute Scenarios
    • 4. Module View
      • 4.1 Primary Presentation
      • 4.2 Element Catalog
      • 4.3 Context Diagram
      • 4.4 Behaviour Diagram
      • 4.5 Rationale
    • 5. Component and Connector View
      • 5.1 Primary Presentation
      • 5.2 Element Catalog
      • 5.3 Interface Documentation
        • 5.3.1 Interface
        • 5.3.2 Interface
      • 5.4 Context Diagram
      • 5.5 Variability Guide
        • 5.5.1 Adding/Removing Formulae in homebrew-core
        • 5.5.2 Managing Custom Formulae in homebrew-core
      • 5.6 Behaviour Diagram
      • 5.7 Rationale
    • 6. Code Quality and Technical Debt
      • 6.1 Code Quality Analysis Tools
        • 6.1.1 SonarQube
        • 6.1.2 CodeClimate
        • 6.1.3 CodeScene
      • 6.2 Analysis of Issues
        • 6.2.1 Primary Refactoring Targets
        • 6.2.2 Change Management
    • 7. Conclusion
    • 8. References
  • Open source contributions
Powered by GitBook
On this page
  • Keras
  • Toyplot
  • Cartographer
  • Issues encountered with submitting a pull request
  • RocketChat
  • SwaggerUI
  • Tensorboard
  • Strapi
  • Homebrew

Open source contributions

Previous8. References

Last updated 7 years ago

This chapter outlines some of the contributions---in the form of pull requests---made by several teams to their open source project.

Keras

This pull request fixes a reported issue in the preprocessing module of Keras related to tokenizing text input data. It corrects the behavior to allow for multi-character separators between tokens in the input, which had been documented as the intended behavior, but was not correctly implemented. Providing support for the differing string implementations in Python 2 and Python 3 introduced some additional complexity to the change. The pull request also included regression tests for cases which would have failed on the previous version.

François Chollet, the lead developer of Keras, asked about the performance impact of the change, and a variety of benchmarks for different use cases were provided by our team. The pull request was merged shortly after.

Toyplot

When formatting tables, developers can opt to use a Formatter class for their values, however Toyplot only had Formatters for Float values. In our pull request we added Unit and Currency Formatters, and accompanying tests and documentation. Users can now use our classes to format different units such as centimeters, inches, and pixels, or format currencies such as euros, pounds, or different dollars.

Cartographer

Issues encountered with submitting a pull request

      Due to the nature of Cartographer our team had a difficult time making a meaningful contribution to the code base. Cartographer is in a late stage of its development. In 2016 Cartographer was released as open-source code, but it had already been in development for 2 years. Cartographer has been a complete product for awhile now and is written in a style which we assume to be inhouse to Google that we are unfamiliar with. Our team has looked through the , but has had a hard time finding a good issue to pursue.

      Cartographer, as can be grasped from the rest of the report, is a complicated program that is very tightly coupled. Cartographer has already been through many steps to increase performance and is built around threading and protobuffers. These optimizations mean small changes can have far reaching effects that our team is unsure of due to very limited C++ knowledge.

      One of the open topics for Cartographer that we were advised to look at was a . This refactor aims to increase code quality and security by changing functions in a file to const type. Changing these functions to const type will help protect data inside objects in Cartographer. Due to limited C++ knowledge our team was uncomfortable making such a change as the code follows a style which our group does not understand well enough to write. While it is still possible to trace code and gain insight, changes to major files are not something we wanted to burden the Cartographer team with. Another problem we noticed is the has a , but no source. Our team has made the assumption this request is obsolete due to the current refactoring of mapping_2D and mapping_3D.

RocketChat

While using CodeScene as the code quality analysis tool, we identified issues in the following aspects of Javascript code for uploading files to Amazon server: 1. The error handling for a valid file url was missing. 2. The codebase did not use the Node’s event handling pipeline and thus was divergent from that standard.

SwaggerUI

Tensorboard

According to the report of SonarQube and CodeScene, duplication is one of the main issues causing the technique debt as the expansion of this project. In addition, SonarQube reports some conditional structures contain two branches with same implementation. The pull request tackles these two issues. We use class inheritance to eliminate the duplication and delete the redundancy branch in "if" structure. Furthermore, we modified the related files to ensure the validity of this project. After finishing all the changes and tests, we use SonarQube to scan the project, the duplication rate of the project decreases from 9.2% to 2.5%.

Strapi

Strapi with its new version is now compatible with Mongo and SQL databases. By convention, the SQL databases uses the id attribute to identify the entries. But, Mongo uses _id as the identifier. To make the backend and frontend part uniform duplication of the Mongoo _id attribute is implemented.

However, We found that the id and _id are duplicated in the JSON response from the API as well. It is unnecessary to return redundant value of ids (id and _id) with every API request made. So, we are proposing changes to Strapi-generate-api package to bandaid this issue with this pull request,

Homebrew

    • The brew search logic currently searches broadly, and then processes the JSON response locally to filter some results out. We saw an opportunity to improve on this approach by making the search more specific, which avoids having to filter out the response. This improves the performance of the search function.

    • This change also simplified the source code itself, which increases the maintainability for developers, with the added bonus of reducing cognitive complexity.

    • Since the local Hombrew installation makes a network transported query to the GitHub API server, it's important to handle the errors in case of network issues, server crashes, or similar. Implementing a begin-rescue block provides a measure of error handling, such that a failure in one area will not cause the running program to fail altogether. This inherently increases the reliability of the system.

    • Homebrew relies on the open source community to maintain its Formulae and Casks, so when a new version of a Homebrew-indexed application is released, the version must be updated in Homebrew's Caskroom. This involves downloading the newly released product as a binary, calculating the SHA256 hash of the binary, and verifying that value against the hash provided by the product owner.

      The issue we are attempting to pursue involves . Following the laid out in Cartographer, we tried to make contact with the team in February in order to seek some guidance. Unfortunately it seems our request was lost and we were unable to connect with the team. Due to the requirements of our project we decided to move forwards with this request to the best of our ability. As is we have submitted some , but our unsure of where to move from here. We hope our contribution will make an advancement in the codes documentation or act as a stepping stone for future documentation.

The issue has been reported at . The error handling and the asynchronous call functionality was added to the codebase.

After our analysis and system study, we found that the component 'HighlightCode' does not handle large inputs very well. The component would expand as far as possible to fit the content(normal behavior), making the page extremely long and hard to use. Since Usability is a part of our QAS, we thought of fixing this. This could also be related to . By making the component scrollable, the page remains manageable even when previewing very large responses. We've also added a button to download the contents displayed in the 'HighlightCode' component.

Pull Request
Pull Request
https://github.com/googlecartographer/cartographer/issues/53
issue list
refactor
target of the change
header file
documentation with Docker
contribution guide
general building and running documentation
Pull Request
https://github.com/RocketChat/Rocket.Chat/issues/10289
Pull Request
#3640
Pull Request
Pull Request
Improving maintainability, performance, and reliability in brew search
Updating a Cask