cyclejs/cycle-core

View on GitHub

Showing 188 of 188 total issues

Function timeDriver has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function timeDriver(sink: any): any {
  let time = 0;
  const frameCallbacks: Array<any> = [];
  const scheduler = makeScheduler();

Severity: Minor
Found in time/src/time-driver.ts - About 1 hr to fix

    Function intent has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function intent(domSource, timeSource) {
      const UP_KEYCODE = 38
      const DOWN_KEYCODE = 40
      const ENTER_KEYCODE = 13
      const TAB_KEYCODE = 9
    Severity: Minor
    Found in examples/advanced/autocomplete-search/src/app.js - About 1 hr to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        const changeColorReducer$ = action$
          .filter(a => a.type === 'CHANGE_COLOR')
          .map(action => function changeColorReducer(oldState) {
            return {color: action.payload, width: oldState.width};
          });
      Severity: Major
      Found in examples/advanced/many/src/Item.js and 1 other location - About 1 hr to fix
      examples/advanced/many/src/Item.js on lines 23..27

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 69.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        const changeWidthReducer$ = action$
          .filter(a => a.type === 'CHANGE_WIDTH')
          .map(action => function changeWidthReducer(oldState) {
            return {color: oldState.color, width: action.payload};
          });
      Severity: Major
      Found in examples/advanced/many/src/Item.js and 1 other location - About 1 hr to fix
      examples/advanced/many/src/Item.js on lines 29..33

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 69.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      export function makeHashHistoryDriver(
        options?: HashHistoryOptions
      ): HistoryDriver {
        const history = createHashHistory(options);
        return function hashHistoryDriver(sink$: Stream<HistoryInput | string>) {
      Severity: Major
      Found in history/src/drivers.ts and 1 other location - About 1 hr to fix
      history/src/drivers.ts on lines 43..50

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 69.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      export function makeServerHistoryDriver(
        options?: MemoryHistoryOptions
      ): HistoryDriver {
        const history = createMemoryHistory(options);
        return function serverHistoryDriver(sink$: Stream<HistoryInput | string>) {
      Severity: Major
      Found in history/src/drivers.ts and 1 other location - About 1 hr to fix
      history/src/drivers.ts on lines 52..59

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 69.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function renderNodeLabel has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function renderNodeLabel(node: StreamGraphNode, zap: Zap | null, style: string): VNode {
        let label = '';
        if (zap) {
          // MUTATION!
          if (Array.isArray(zap.value)) {
      Severity: Minor
      Found in devtool/src/panel/graph/view.ts - About 1 hr to fix

        Function reducers has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function reducers(actions) {
          const moveHighlightReducer$ = actions.moveHighlight$
            .map(delta => function moveHighlightReducer(state) {
              const suggestions = state.get('suggestions')
              const wrapAround = x => (x + suggestions.length) % suggestions.length
        Severity: Minor
        Found in examples/advanced/autocomplete-search/src/app.js - About 1 hr to fix

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

          function makeThrottleAnimation(
            timeSource: any,
            schedule: any,
            currentTime: () => number
          ) {
          Severity: Minor
          Found in time/src/throttle-animation.ts - About 1 hr to fix

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

            function makeDiagram(
              schedule: any,
              currentTime: () => number,
              interval: number,
              setMaxTime: any
            Severity: Minor
            Found in time/src/diagram.ts - About 1 hr to fix

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

              function renderCommonNode(node: StreamGraphNode, zaps: Array<Zap>): VNode {
                const index = zaps.map(zap => zap.id).indexOf(node.id);
                const zap = index === -1 ? null : zaps[index];
              
                return svg.g([
              Severity: Minor
              Found in devtool/src/panel/graph/view.ts - About 1 hr to fix

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

                  private setupNonBubblingListener(
                    input: NonBubblingMeta
                  ): void {
                    const [_, eventType, elementFinder, destination] = input;
                    if (!this.origin) {
                Severity: Minor
                Found in dom/src/EventDelegator.ts - About 1 hr to fix

                  Function diagram has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    return function diagram(diagramString: string, values = {}): Stream<any> {
                      const characters = diagramString.split('');
                      const stream = xs.create();
                      function valueFor(character: string) {
                        if (character in values) {
                  Severity: Minor
                  Found in time/src/diagram.ts - About 1 hr to fix

                    Function throttleAnimation has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      return function throttleAnimation<T>(inputStream: Stream<T>): Stream<T> {
                        const source = timeSource();
                        const stream = xs.fromObservable(inputStream);
                        let animationListener: any = null;
                    
                    
                    Severity: Minor
                    Found in time/src/throttle-animation.ts - About 1 hr to fix

                      Function replicateMany has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function replicateMany<Si extends any>(
                        sinks: Si,
                        sinkProxies: SinkProxies<Si>
                      ): DisposeFunction {
                        const scheduleMicrotask = quicktask();
                      Severity: Minor
                      Found in run/src/internals.ts - About 1 hr to fix

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

                          public _n(inst: InternalInstances<Si>): void {
                            this.inst = inst;
                            const arrSinks = inst.arr;
                            const ils = this.ils;
                            const out = this.out;
                        Severity: Minor
                        Found in state/src/pickCombine.ts - About 1 hr to fix

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

                          function makePeriodic(createOperator: () => OperatorArgs<any>) {
                            const {schedule, currentTime} = createOperator();
                          
                            return function periodic(period: number): Stream<number> {
                              let stopped = false;
                          Severity: Minor
                          Found in time/src/periodic.ts - About 1 hr to fix

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

                            function makeClickListener(push: (p: string) => void) {
                              return function clickListener(event: MouseEvent) {
                                if (which(event) !== 1) {
                                  return;
                                }
                            Severity: Minor
                            Found in history/src/captureClicks.ts - About 1 hr to fix

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

                              function runUpdateChangelogs() {
                                packagesWithChangelog
                                  .filter(function (package) {
                                    if (typeof argPackage === 'string' && argPackage.length > 0) {
                                      return argPackage === package;
                              Severity: Minor
                              Found in .scripts/update-changelogs.js - About 1 hr to fix

                                Function main has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function main(sources: Sources): Sinks {
                                  const firstName$ = sources.DOM
                                    .select('.first')
                                    .events('input')
                                    .map(ev => (ev.target as HTMLInputElement).value)
                                Severity: Minor
                                Found in examples/intermediate/hello-lastname/src/index.ts - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language