Git Product home page Git Product logo

calculator's Introduction

Software Engineer and Oracle certified in Java (OCA)

Experienced in Java based technologies such as Spring projects, Docker, Angular and more.

I'm a lifelong learner and I love sharing my knowledge with the community, checkout out my free YouTube tutorials.

calculator's People

Contributors

daniellyi avatar houarizegai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

calculator's Issues

High cyclomatic and cognitive complexity in initButtons method

The initButtons method in the project has extremely high cyclomatic complexity (52.0) and cognitive complexity (156.0). These values significantly exceed the acceptable limits, indicating that the method is difficult to understand, test, and maintain. In order to manage it, you could refactor the initButtons method by breaking it down into smaller, more manageable sub-methods to reduce complexity and improve code maintainability.

Code Testing

Anyone who wants to write unit tests for this project? That will be a good contribution.

CreateButton – Separate query from modifier refactoring technique

Hi, I noticed that there exists createButton() method in Calculator.java that returns a JButton, but it also updates the window when adding the button that is returned.

Screenshot from 2024-01-08 12-46-42

One path to take might be to split the method into two: getButton() and make use of the add() method outside the method. Only as a refactoring technique practice. Have a nice day!

Screenshot from 2024-01-08 12-47-35

Patrones de diseño

Muy buenas noches soy un estudiante de Ingeniería en Computación y me ha tocado hacer un deber de Diseño de Software en el que debo buscar repositorios y ver fallos que se puedan solucionar con algún patrón de diseño. En este caso te recomiendo que apliques el patrón Composite para mantener una estructura sobre las partes de la factura y así poder manejar la organización de los datos que esta conlleva a su vez, que se maneja los cálculos de dicha factura de forma ordenada. Espero que mi recomendación te sirva de mucho.

Code Smells

buenas tardes pues revisando tu pryecto vi que tenia code smells como Large Class , Duplicate Code y Data Clumps
CaptMovemethod
CaptMoveSubclas
CaptReplaceAlgorithm
CaptParameterObj

Patrones a usar posiblemente

Hola buen programa! pero siento que puede mejorar si usas el patron
Simple Factory
diagrama fin
Observer
diagramfin2
Factory Method
facotry marhtd

Al momento de crear la calculadora para que asi se haga mas facil el manejo de metodos

Internal State Exposure in ThemeList.java Class:

I’ve identified a security vulnerability related to the exposure of the internal representation in the “ThemeList.java” class.

FirstBug

Method getThemes() in the ThemeList.java class returns a direct reference to its private ‘themes’ list. Therefore, any caller can maliciously modify internal representation leading to data corruption. For example, the caller can perform the operation “themeList.getTHemes().clear()” and clear the data in the list.

Operator

selectedOperator = '√'; it is not supproting so i changed it with selectedOperator = '\u221A'; and its working properly if there is an any issue with what i have changed please let me know

Keyboard shortcut

We need a keyboard listener (for example, when we press the numbers buttons it should appear on the screen).

SOLID principles

Hi, me and my team where checking your project and we wanted to suggest you some changes in orden to apply the S.O.L.I.D principles.

SRP, this principle states that every module or class should have responsibility over a single part of the functionality provided by the software and since everything is in one class you are violating it. One way of solving this is making a separted class for the operations, in your project you use a method called calc for solving the math problems, so in this new class Operation we can have this method, and at the same time apply the principle giving this classs the single responsability to calculate each operation.
Now by making this another problem comes along, now we are violating the DIP principle because it states that "High-level modules should not depend on low-level modules. Both should depend on abstractions", thats why we can make a new package Operations, and inside this one create a father class Operation and each of the possible operation (such as Add, Substract, etc) child classes. Also by doing this we are applying the LSP principle correctly because it states that objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program, and here each subclass (child) will recieve the same parameters (double x, double y) and return a result.
Thank you for your time, I apologize in case I said something mistaken.

Adding features

Hello, i want to contribute and i was thinking of adding sin and cos operator at scientific calc. Also, i was thinking about changing root operation to take nth root and not only square. How about that?

Using code as an example

I’m using this code as an example but I am getting the following errors:

com/houarizegai/calculator/Calculator.java:351: error: unclosed character literal
opt = '√';
^
com/houarizegai/calculator/Calculator.java:351: error: unclosed character literal
opt = '√';
^
com/houarizegai/calculator/Calculator.java:351: error: not a statement
opt = '√';
^
3 error

I’m running NetBeans 12.4, JDK 16.0.1, Maven Plug-in 3.0.0 with Java 8 installed. Am I doing something wrong?

Missing Pi Button

Hello, I noticed that the calculator you have is missing a Pi button. I saw a comment in another thread that said they added a Pi button, but I do not see it in the program.

Bb

He hjj

Need a pi number

Hello, I want to develop this application and an idea came to my mind. I want to add pi number to this application, I will try to do it but I'm sure I can't do it either, so please do it too.

Better visualization of expression string

Hi, I am new to open source and I wanted to work on this calculator application.
When we enter an expression like 4 + 5 after entering + 4 disappears. We can keep complete expression until someone enters = sign.
I would like to work on this.
Please let me know if it is fine.

Patrones de Diseño

Hola soy Kevin Bautista estudiante de la universidad ESPOL en Ecuador, como deber tuve que analizar tu repositorio, aquí tienes una serie de sugerencias para implementar patrones de diseño en tu código.
Tarea3_Patrones.docx

Add Themes

We need beautiful themes like the Dark theme or enhance the UI look.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.