janek26/ByteFiddler

View on GitHub

Showing 19 of 57 total issues

Function operationSwitch has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

function operationSwitch(state, action) {
  let op = action.payload;
  let carry = 0;

  // AND/OR/XOR/XNOR benötigen nur die beiden flags
Severity: Minor
Found in reducers/operations/operationSwitch.js - About 5 hrs 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

Function render has 118 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render () {
    const { toggleBit, bitDisplay } = this.props

    var hrefLink = process.env.NODE_ENV === 'production' ? 'logicalPage.html' : '/logicalPage';

Severity: Major
Found in pages/index.js - About 4 hrs to fix

    Function render has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        return(
          <div>
          <style jsx>{`
            .topic {
    Severity: Major
    Found in components/logicalComponents/LogicalOperations.js - About 2 hrs to fix

      Function render has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          let name  = this.props.name,
              props = this.props,
              activeGroupOperation = this.props.activeGroupOperation,
              activeGroup = this.props.activeGroup,
      Severity: Major
      Found in components/logicalComponents/BitGroupActions.js - About 2 hrs to fix

        Function render has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            return(
              <div>
              <style jsx>{`
                .topic {
        Severity: Major
        Found in components/logicalComponents/Flags.js - About 2 hrs to fix

          Function render has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
            var tools = [];
          
            for( var i = 0; i<256; i++ ){
                tools[i] = <tr key={i} >
          Severity: Major
          Found in components/Erklaerungcomponents/Erklaerung.js - About 2 hrs to fix

            Function compileBordersFromDigit has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

            const compileBordersFromDigit = (digit, isTopBox = false) => {
              const output = []
            
              if(isTopBox) {
                const needsTopBorder = [0,2,3,5,6,7,8,9]
            Severity: Minor
            Found in components/Digit.js - About 2 hrs 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

            Function bitgroupOperation has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function bitgroupOperation(state, action) {
              let op      = action.payload.operation;
              let group   = action.payload.group;
              let bits    = 0,
                  decVal  = 0;
            Severity: Major
            Found in reducers/operations/bitgroupOperation.js - About 2 hrs to fix

              Function render has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render() {
                  var hrefLink = process.env.NODE_ENV === 'production' ? 'index.html' : '/';
              
                  return (
                    <div className="htmlBackground">
              Severity: Minor
              Found in pages/logicalPage.js - About 1 hr to fix

                Function render has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render() {
                    let props = this.props;
                    let activeOperation = this.props.activeOperation;
                
                    var operations =
                Severity: Minor
                Found in components/logicalComponents/BitOperations.js - About 1 hr to fix

                  Function operationSwitch has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function operationSwitch(state, action) {
                    let op = action.payload;
                    let carry = 0;
                  
                    // AND/OR/XOR/XNOR benötigen nur die beiden flags
                  Severity: Minor
                  Found in reducers/operations/operationSwitch.js - About 1 hr to fix

                    Function render has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      render() {
                        let restString = "";
                    
                        if (this.props.decValues.rest > 0)
                          restString = "Rest: " + this.props.decValues.rest;
                    Severity: Minor
                    Found in components/logicalComponents/DecValues.js - About 1 hr to fix

                      Function render has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        render() {
                          let op = this.props.activeHelp,
                              topic = this.props.info[op][0],
                              descr = this.props.info[op][1];
                      
                      
                      Severity: Minor
                      Found in components/logicalComponents/LogInfo.js - About 1 hr to fix

                        Function logicalReducer has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function logicalReducer(state = initialState, action) {
                          switch (action.type) {
                            case CHANGE_BIT:
                              return {
                                ...state,
                        Severity: Minor
                        Found in reducers/logicalReducer.js - About 1 hr to fix

                          Function compileBordersFromDigit has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const compileBordersFromDigit = (digit, isTopBox = false) => {
                            const output = []
                          
                            if(isTopBox) {
                              const needsTopBorder = [0,2,3,5,6,7,8,9]
                          Severity: Minor
                          Found in components/Digit.js - About 1 hr to fix

                            Function render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                              render() {
                                let name  = this.props.name,
                                    props = this.props,
                                    activeGroupOperation = this.props.activeGroupOperation,
                                    activeGroup = this.props.activeGroup,
                            Severity: Minor
                            Found in components/logicalComponents/BitGroupActions.js - About 55 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

                            Function bitgroupOperation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function bitgroupOperation(state, action) {
                              let op      = action.payload.operation;
                              let group   = action.payload.group;
                              let bits    = 0,
                                  decVal  = 0;
                            Severity: Minor
                            Found in reducers/operations/bitgroupOperation.js - About 45 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

                            Function render has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                              render() {
                                let props = this.props;
                                let activeOperation = this.props.activeOperation;
                            
                                var operations =
                            Severity: Minor
                            Found in components/logicalComponents/BitOperations.js - About 45 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

                            Function changeBit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function changeBit(state, action) {
                              let group = action.payload[0];
                              let index = action.payload[1];
                            
                              if (group == "first") {
                            Severity: Minor
                            Found in reducers/changeBitReducer.js - About 25 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