nihas101/java-chip-8-emulator

View on GitHub

Showing 7 of 14 total issues

Method valueOf has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static int valueOf(String keyString) throws UnknownEmulatorKeyException {
        int key;

        switch (keyString) {
            case "0":
Severity: Major
Found in src/main/java/de/nihas101/chip8/utils/keyConfiguration/Keys.java - About 2 hrs to fix

    Method setupTextField has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private void setupTextField(EmulatorKey emulatorKey, KeyCode key) {
            if (emulatorKey == null || key == null) return;
    
            switch (emulatorKey.getKeyName()) {
                case "0":
    Severity: Major
    Found in src/main/java/de/nihas101/chip8/config/ConfigureController.java - About 2 hrs to fix

      Method opCode8XYN has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private void opCode8XYN(OPCode opCode) throws UnknownOPCodeException {
              switch (opCode.getByte(3)) {
                  case 0x0:
                      assign(opCode.getByte(1), opCode.getByte(2));
                      break;
      Severity: Minor
      Found in src/main/java/de/nihas101/chip8/hardware/CentralProcessingUnit.java - About 1 hr to fix

        Method arithmeticOperation has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            private UnsignedByte arithmeticOperation(int Vx, int Vy, BinaryOperation arithmeticOperation, int onOverFlow, int noOverFlow) {
        Severity: Minor
        Found in src/main/java/de/nihas101/chip8/hardware/CentralProcessingUnit.java - About 35 mins to fix

          Method setupCharacter has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              private UnsignedByte[] setupCharacter(int one, int two, int three, int four, int five) {
          Severity: Minor
          Found in src/main/java/de/nihas101/chip8/hardware/memory/Memory.java - About 35 mins to fix

            Method drawLineOfSprite has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                private void drawLineOfSprite(int xCoordinate, int yCoordinate, UnsignedByte data, int mask, UnsignedShort yLine) {
            Severity: Minor
            Found in src/main/java/de/nihas101/chip8/hardware/CentralProcessingUnit.java - About 35 mins to fix

              Method changed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  private void changed(Change change) {
                      if (change.isAdded()) {
                          if (change.getControlText().contains(".")) {
                              if (change.getText().matches("[^0-9]")) change.setText("");
                          } else if (change.getText().matches("[^0-9.]")) change.setText("");
              Severity: Minor
              Found in src/main/java/de/nihas101/chip8/MainController.java - About 35 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Severity
              Category
              Status
              Source
              Language