karyfoundation/graph

View on GitHub

Showing 17 of 37 total issues

Dot has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

        export class Dot {

            //
            // ─── GLOBALS ─────────────────────────────────────────────────────
            //
Severity: Minor
Found in core/objects/dot/dot.ts - About 2 hrs to fix

    Function BFS has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

            export function BFS ( start: Dot, steps: number ) {
                let bfs = new Array<Array<Dot>>( );
                let checked = new Array<Boolean>( );
    
                for ( let it = 0; it < KaryGraph.Dot.TotalDots; it++ ) {
    Severity: Minor
    Found in core/api/stdlib/algorithms.ts - About 1 hr 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 Tree has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            export function Tree ( ): boolean {
    
                // vars
                var map = new Map( );
                var keys = Object.keys( Storage.Nodes );
    Severity: Minor
    Found in core/api/stdlib/sortings.ts - About 1 hr to fix

      Function Tree has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

              export function Tree ( ): boolean {
      
                  // vars
                  var map = new Map( );
                  var keys = Object.keys( Storage.Nodes );
      Severity: Minor
      Found in core/api/stdlib/sortings.ts - About 1 hr 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 RenderSpiral has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              export function RenderSpiral ( ) {
      
                  //
                  // ─── ENUMS ───────────────────────────────────────────────────────
                  //
      Severity: Minor
      Found in core/rendering/spiral.ts - About 1 hr to fix

        Function GenerateSomeRandomNodes has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                export function GenerateSomeRandomNodes ( howManyNodes: number ) {
                    // defs
                    const baseUnit = 120;
                    const widthUnit = Math.floor( GraphWidth / baseUnit );
                    const heightUnit = Math.floor( GraphHeight / baseUnit );
        Severity: Minor
        Found in core/editor/graph.ts - About 1 hr to fix

          Function graphfrommatrix has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              function graphfrommatrix ( matrix: number[][] ) {
                  var numberOfNodes = matrix.length;
                  for ( var i = 0; i < numberOfNodes; i++ ) {
                      if ( matrix[ i ].length != numberOfNodes ) {
                          // KaryGraph.UI.Console.PrintError( "Invalid matrix." );
          Severity: Minor
          Found in core/api/api.ts - About 1 hr 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 GraphInitMonacoOnStart has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function GraphInitMonacoOnStart ( ) {
          
                  function uriFromPath ( _path ) {
                      var pathName = path.resolve( _path ).replace( /\\/g, '/' );
                      if ( pathName.length > 0 && pathName.charAt( 0 ) !== '/' ) {
          Severity: Minor
          Found in javascript/graph-monaco.js - About 1 hr to fix

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

                    export function BFS ( start: Dot, steps: number ) {
                        let bfs = new Array<Array<Dot>>( );
                        let checked = new Array<Boolean>( );
            
                        for ( let it = 0; it < KaryGraph.Dot.TotalDots; it++ ) {
            Severity: Minor
            Found in core/api/stdlib/algorithms.ts - About 1 hr to fix

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

                      function OnPromptArrowsClicked ( ev: KeyboardEvent ) {
                          // if ( !ev.metaKey ) return;
                          let key = ev.which || ev.keyCode;
                          if ( key === 38 ) {
                              /** Up Arrow Key */
              Severity: Minor
              Found in core/ui/editor-tab/notebook/programmer.ts - 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 Generate has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      export function Generate ( style: Style,
                                     languageCharacter: string,
                                               tabSize: number,
                                          insertSpaces: boolean,
                                                 text?: string,
              Severity: Minor
              Found in core/karyfoundation/comment/core.ts - About 45 mins to fix

                Function DragModeFunctionMoveMode has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        export function DragModeFunctionMoveMode( circle: ISnapObject, dx: number,
                                                                  dy: number, posx: number, posy: number ) {
                Severity: Minor
                Found in core/objects/dot/drag-move.ts - About 35 mins to fix

                  Function DragModeFunctionEditMode has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          export function DragModeFunctionEditMode( circle: ISnapObject, dx: number,
                                                                    dy: number, posx: number, posy: number ) {
                  Severity: Minor
                  Found in core/objects/dot/drag-move.ts - About 35 mins to fix

                    Function DragModeFunctionSelectMode has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            export function DragModeFunctionSelectMode( circle: ISnapObject, dx: number,
                                                                        dy: number, posx: number, posy: number ) {
                    Severity: Minor
                    Found in core/objects/dot/drag-move.ts - About 35 mins to fix

                      Function DragModeFunctionRemoveMode has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              export function DragModeFunctionRemoveMode( circle: ISnapObject, dx: number,
                                                                          dy: number, posx: number, posy: number ) {
                      Severity: Minor
                      Found in core/objects/dot/drag-move.ts - About 35 mins to fix

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

                                export function GenerateSayHTML ( input: any ): string {
                        
                                    // if were going to have an undefined type.
                                    if ( input == undefined ) {
                                        return SayImplementations.SayUndefined( );
                        Severity: Minor
                        Found in core/ui/editor-tab/notebook/say.ts - 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

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

                            function size ( dots?: Array<KaryGraph.API.AbstractionLayer.DotObjectOrDotID> ): number {
                                var size: number = 0;
                                if ( dots === undefined ) {
                                    for ( var i = 0; i < KaryGraph.Dot.TotalDots; i++ ) {
                                        size += getdot(i + 1).NumberOfInputs();
                        Severity: Minor
                        Found in core/api/api.ts - 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